Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { Type MessageType // The type of the message Content string // The content of the message Sender string // The sender of the message (custom user name) FunctionName string // The name of the function (if applicable) }
Message represents a single message in the chat history.
type MessageHistory ¶
type MessageHistory struct {
// contains filtered or unexported fields
}
MessageHistory stores a history of messages.
func NewMessageHistory ¶
func NewMessageHistory() *MessageHistory
NewMessageHistory creates a new instance of MessageHistory.
func (*MessageHistory) AddMessage ¶
func (m *MessageHistory) AddMessage(msgType MessageType, sender, functionName, content string)
AddMessage adds a new message to the history.
func (*MessageHistory) GetAllMessagesAsString ¶
func (m *MessageHistory) GetAllMessagesAsString() string
GetAllMessagesAsString returns all messages in the history as a single string.
type MessageType ¶
type MessageType int
MessageType is an enumeration of different types of messages.
const ( FunctionResult MessageType = iota // Represents a function result AIMessage // Represents a message from AI HumanMessage // Represents a message from a human ChatMessage // Represents a generic chat message )
Click to show internal directories.
Click to hide internal directories.