goinworld

package module
v0.0.0-...-9572309 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2023 License: MIT Imports: 5 Imported by: 0

README

go Inworld.AI client library

unofficial inworld client / sdk written in go

wip

build proto
protoc --go_out=. --go-grpc_out=. -I proto/ proto/* && \
 mv ./github.com/zivoy/go-inworld/internal/protoBuf ./internal && \
 rm -r ./github.com

Documentation

Index

Constants

View Source
const (
	InworldPacketUnknown = InworldPacketType(iota)
	InworldPacketText
	InworldPacketAudio
	InworldPacketTrigger
	InworldPacketEmotion
	InworldPacketControl
	InworldPacketSilence
	InworldPacketCancelResponse
)
View Source
const (
	InworldControlUnknown = InworldControlType(iota)
	InworldControlInteractionEnd
)
View Source
const (
	EmotionBehaviorNeutral = EmotionalBehavior(iota)
	EmotionBehaviorDisgust
	EmotionBehaviorContempt
	EmotionBehaviorBelligerence
	EmotionBehaviorDomineering
	EmotionBehaviorCriticism
	EmotionBehaviorAnger
	EmotionBehaviorTension
	EmotionBehaviorTenseHumor
	EmotionBehaviorDefensiveness
	EmotionBehaviorWhining
	EmotionBehaviorSadness
	EmotionBehaviorStonewalling
	EmotionBehaviorInterest
	EmotionBehaviorValidation
	EmotionBehaviorAffection
	EmotionBehaviorHumor
	EmotionBehaviorSurprise
	EmotionBehaviorJoy
)
View Source
const (
	EmotionalStrengthUnspecified = EmotionalStrength(iota)
	EmotionalStrengthWeak
	EmotionalStrengthStrong
	EmotionalStrengthNormal
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	Name        string
	IsPlayer    bool
	IsCharacter bool
}

type AdditionalPhonemeInfo

type AdditionalPhonemeInfo struct {
	Phoneme     string
	StartOffset time.Duration // should be used in seconds
}

type ApiKey

type ApiKey struct {
	Key    string
	Secret string
}

func (*ApiKey) Validate

func (a *ApiKey) Validate() error

type AudioEvent

type AudioEvent struct {
	Chunk                 []byte
	AdditionalPhonemeInfo []*AdditionalPhonemeInfo
}

type CancelResponsesEvent

type CancelResponsesEvent struct {
	InteractionId uuid.UUID
	UtteranceId   []uuid.UUID
}

type ClientConfig

type ClientConfig struct {
	Connection   *ConnectionConfig
	Capabilities *engine.CapabilitiesRequest //todo replace with something exposable
}

type Config

type Config struct {
	EngineHost string
	EngineSSL  bool
	StudioHost string
	StudioSSL  bool
}

func NewConfig

func NewConfig() *Config

type ConnectionConfig

type ConnectionConfig struct {
	AutoReconnect    bool
	DisconnectTimout time.Duration
}

type ControlEvent

type ControlEvent struct {
	Type InworldControlType
}

type EmotionEvent

type EmotionEvent struct {
	Behavior EmotionalBehavior
	Strength EmotionalStrength
}

type EmotionalBehavior

type EmotionalBehavior uint8

type EmotionalStrength

type EmotionalStrength uint8

type GenerateSessionTokenFunc

type GenerateSessionTokenFunc = func() func(token session.Token)

type InworldClient

type InworldClient struct {
	// contains filtered or unexported fields
}

func (*InworldClient) Validate

func (c *InworldClient) Validate() error

type InworldControlType

type InworldControlType uint8

type InworldPacket

type InworldPacket struct {
	PacketType InworldPacketType

	Date     time.Time
	PacketId *PacketId
	Routing  *Routing

	//events
	Text            *TextEvent
	Audio           *AudioEvent
	Control         *ControlEvent
	Trigger         *TriggerEvent
	Emotions        *EmotionEvent
	Silence         *SilenceEvent
	CancelResponses *CancelResponsesEvent
}

func (*InworldPacket) IsAudio

func (i *InworldPacket) IsAudio() bool

func (*InworldPacket) IsCancelResponse

func (i *InworldPacket) IsCancelResponse() bool

func (*InworldPacket) IsControl

func (i *InworldPacket) IsControl() bool

func (*InworldPacket) IsEmotion

func (i *InworldPacket) IsEmotion() bool

func (*InworldPacket) IsInteractionEnd

func (i *InworldPacket) IsInteractionEnd() bool

func (*InworldPacket) IsSilence

func (i *InworldPacket) IsSilence() bool

func (*InworldPacket) IsText

func (i *InworldPacket) IsText() bool

func (*InworldPacket) IsTrigger

func (i *InworldPacket) IsTrigger() bool

type InworldPacketType

type InworldPacketType uint8

type PacketId

type PacketId struct {
	PacketId      uuid.UUID
	UtteranceId   uuid.UUID
	InteractionId uuid.UUID
}

type Routing

type Routing struct {
	Source *Actor
	Target *Actor
}

type SilenceEvent

type SilenceEvent struct {
	Duration time.Duration // should be used in ms
}

type TextEvent

type TextEvent struct {
	Text  string
	Final bool
}

type TriggerEvent

type TriggerEvent struct {
	Name       string
	Parameters []*TriggerParameter
}

type TriggerParameter

type TriggerParameter struct {
	Name  string
	Value string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL