Documentation ¶
Index ¶
- Variables
- func RunConv(actionID uid.ID, conv *Conversation, trigger string) error
- type Action
- type ActionMeta
- type Character
- type CharacterType
- type Characters
- type ConvMeta
- type Conversation
- type ConversationContainer
- type Engine
- type GPT3
- type Info
- type Msg
- type Msgs
- type OldCharacter
- type OldCharacters
- type OldMsg
- type OldMsgs
- type OldScenario
- type Resp
- type Scenario
- type ScenarioMeta
- type ScenarioSummary
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var Actions = map[uid.ID]Action{}
View Source
var AllCharacterType = []CharacterType{ CharacterTypeNarration, CharacterTypeInitial, CharacterTypeGpt3, CharacterTypeUser, }
View Source
var Conversations = map[uid.ID]*Conversation{}
View Source
var OldScenarios map[string]OldScenario
View Source
var Scenarios map[string]Scenario
Functions ¶
Types ¶
type Action ¶
type Action struct { Source string Meta ActionMeta }
type ActionMeta ¶
type Character ¶
type Character struct { Name string `json:"name"` Type CharacterType `json:"type"` NameVisible bool `json:"add_name_to_gpt"` }
func NewChar ¶
func NewChar(name string, t CharacterType) Character
type CharacterType ¶
type CharacterType string
const ( CharacterTypeNarration CharacterType = "NARRATION" CharacterTypeInitial CharacterType = "INITIAL" CharacterTypeGpt3 CharacterType = "GPT3" CharacterTypeUser CharacterType = "USER" )
type Characters ¶
func NewChars ¶
func NewChars(n, i, g, u string) Characters
func (Characters) String ¶
func (c Characters) String() string
type ConvMeta ¶
type Conversation ¶
type Conversation struct { Meta ConvMeta `json:"meta"` Msgs *Msgs `json:"messages"` Scenario Scenario `json:"-"` Actions map[uid.ID]Action `json:"actions"` Chars Characters `json:"message_types"` State string `json:"state"` // contains filtered or unexported fields }
func (*Conversation) ContentFilter ¶
func (c *Conversation) ContentFilter(text string) (int, error)
func (*Conversation) Refresh ¶
func (c *Conversation) Refresh() error
func (*Conversation) String ¶
func (c *Conversation) String() string
type ConversationContainer ¶
type ConversationContainer struct { Conversation Access []string Lock sync.RWMutex Err error }
func NewConvCont ¶
func NewConvCont(c Conversation) *ConversationContainer
type GPT3 ¶
type GPT3 struct { SummarizeToken int `json:"-" toml:"summarize_token"` ResponseLength int `json:"-" toml:"response_length"` Temperature float32 `json:"-" toml:"temperature"` TopP float32 `json:"-" toml:"top_p"` FrequencyPenalty float32 `json:"-" toml:"frequency_penalty"` PresencePenalty float32 `json:"-" toml:"presence_penalty"` MaxTokens int `json:"-" toml:"max_tokens"` Engine string `json:"-" toml:"engine"` N int `json:"-" toml:"n"` LogProbs float32 `json:"-" toml:"log_probs"` APIKey string `json:"-"` // make sure to not send secrets }
type Msg ¶
type OldCharacter ¶
type OldCharacters ¶
type OldCharacters []OldCharacter
func (OldCharacters) ToCharacters ¶
func (o OldCharacters) ToCharacters() Characters
type OldMsgs ¶
type OldMsgs []OldMsg
func (OldMsgs) ToMsgs ¶
func (o OldMsgs) ToMsgs(chars OldCharacters) Msgs
type OldScenario ¶
type OldScenario struct { Meta ScenarioMeta `json:"meta"` Info Info `json:"info"` Msgs OldMsgs `json:"initial_messages"` Chars OldCharacters `json:"message_types"` // only support one char per type GPT3 GPT3 `json:"gpt_3"` }
func (OldScenario) ToScenario ¶
func (o OldScenario) ToScenario() Scenario
type Resp ¶
type Resp struct { Msg string `json:"msg"` Data interface{} `json:"data"` }
func (Resp) MarshalJSON ¶
type Scenario ¶
type Scenario struct { Meta ScenarioMeta `json:"meta"` Info Info `json:"info"` Msgs *Msgs `json:"initial_messages"` Chars Characters `json:"message_types"` // only support one char per type GPT3 GPT3 `json:"gpt_3"` }
type ScenarioMeta ¶
type ScenarioMeta struct { Title string `toml:"title" json:"title"` Description string `toml:"desc" json:"desc"` Duration time.Duration `toml:"duration" json:"duration"` Level int `toml:"level" json:"level"` }
func (ScenarioMeta) String ¶
func (s ScenarioMeta) String() string
type ScenarioSummary ¶
type ScenarioSummary struct {
Meta *ScenarioMeta `json:"meta"`
}
func (ScenarioSummary) String ¶
func (s ScenarioSummary) String() string
Click to show internal directories.
Click to hide internal directories.