Documentation ¶
Index ¶
- type Conversation
- func (c *Conversation) AddMessage(msg agent.ChatAgentMessage)
- func (c *Conversation) Close()
- func (c *Conversation) GetAgent() *agent.ChatAgent
- func (c *Conversation) GetConfig() *ai.AIConfig
- func (c *Conversation) GetLastMessage() agent.ChatAgentMessage
- func (c *Conversation) GetMessageCount() int
- func (c *Conversation) GetMessages() []agent.ChatAgentMessage
- func (c *Conversation) Kill()
- func (c *Conversation) LoadFromFile(filename string) error
- func (c *Conversation) PreemptiveStart()
- func (c *Conversation) ResetMessages()
- func (c *Conversation) SaveToFile(filename string) error
- func (c *Conversation) SendSystemMessage(msgContent string) (agent.ChatAgentMessage, error)
- func (c *Conversation) SendUserMessage(msgContent string) (agent.ChatAgentMessage, error)
- func (c *Conversation) SetMessages(messages []agent.ChatAgentMessage)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conversation ¶
type Conversation struct {
// contains filtered or unexported fields
}
func NewConversation ¶
func NewConversation(name string, config *ai.AIConfig) *Conversation
NewConversation creates a new conversation with the given name and config. The underlying agent will be started automatically on the first message. If you want to start the agent preemptively, use the PreemptiveStart() function.
func (*Conversation) AddMessage ¶
func (c *Conversation) AddMessage(msg agent.ChatAgentMessage)
Adds a message to the conversation without sending it to the agent.
func (*Conversation) Close ¶
func (c *Conversation) Close()
Close the conversation. This will close the underlying agent.
func (*Conversation) GetAgent ¶
func (c *Conversation) GetAgent() *agent.ChatAgent
func (*Conversation) GetConfig ¶
func (c *Conversation) GetConfig() *ai.AIConfig
func (*Conversation) GetLastMessage ¶
func (c *Conversation) GetLastMessage() agent.ChatAgentMessage
func (*Conversation) GetMessageCount ¶
func (c *Conversation) GetMessageCount() int
func (*Conversation) GetMessages ¶
func (c *Conversation) GetMessages() []agent.ChatAgentMessage
func (*Conversation) Kill ¶
func (c *Conversation) Kill()
Kills and deletes the conversation. This will kill and delete the underlying agent.
func (*Conversation) LoadFromFile ¶
func (c *Conversation) LoadFromFile(filename string) error
func (*Conversation) PreemptiveStart ¶
func (c *Conversation) PreemptiveStart()
Starts the agent underlying the conversation. As the conversation is started automatically on the first message, this function is only useful if you want to start the conversation preemptively due to computational constraints.
func (*Conversation) ResetMessages ¶
func (c *Conversation) ResetMessages()
func (*Conversation) SaveToFile ¶
func (c *Conversation) SaveToFile(filename string) error
func (*Conversation) SendSystemMessage ¶
func (c *Conversation) SendSystemMessage(msgContent string) (agent.ChatAgentMessage, error)
Send a system message to the conversation. The message will be sent to the agent and the agent will respond with a completion.
func (*Conversation) SendUserMessage ¶
func (c *Conversation) SendUserMessage(msgContent string) (agent.ChatAgentMessage, error)
Send a message to the conversation. The message will be sent to the agent and the agent will respond with a completion.
func (*Conversation) SetMessages ¶
func (c *Conversation) SetMessages(messages []agent.ChatAgentMessage)