Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PersonalityBuilder ¶
func PersonalityBuilder() *personalityBuilder
Types ¶
type Charachat ¶
type Charachat struct {
// contains filtered or unexported fields
}
func (*Charachat) PastOpenAIMessages ¶
func (c *Charachat) PastOpenAIMessages(systemPrompt string, token int) []openai.ChatCompletionMessage
func (*Charachat) ResetConversation ¶
type LocalMemory ¶
type LocalMemory struct {
Messages []Message
}
func NewLocalMemory ¶
func NewLocalMemory() *LocalMemory
func (*LocalMemory) AddMessage ¶
func (m *LocalMemory) AddMessage(msg Message)
func (*LocalMemory) DeleteAll ¶
func (m *LocalMemory) DeleteAll()
func (*LocalMemory) GetAllMessage ¶
func (m *LocalMemory) GetAllMessage() []Message
type Message ¶
type Message struct {
Kind MessageUserKind
Text string
}
type MessageUserKind ¶
type MessageUserKind string
const ( MessageUserKindUser MessageUserKind = "user" MessageUserKindBot MessageUserKind = "bot" )
type Option ¶
func WithMemory ¶
func WithOpenAIModel ¶
func WithPersonality ¶
func WithPersonality(personality *Personality) Option
type Personality ¶
type Personality struct {
Name string
// 一人称
Me string
// 二人称
User string
// ユーザー名を上書き可能かどうか
IsUserOverridable bool
// さん、くん、ちゃんなど
UserCallingOut string
// 制約条件
Constraints []string
// 口調
ToneExamples []string
// 行動指針
BehaviorExamples []string
}
Personality 人格を生成する
func (*Personality) SystemPrompt ¶
func (p *Personality) SystemPrompt(userName string) string
Click to show internal directories.
Click to hide internal directories.