Documentation
¶
Index ¶
Constants ¶
View Source
const AssistantRole = "assistant"
View Source
const SystemRole = "system"
View Source
const UserRole = "user"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatHistory ¶
type ChatHistory struct {
Responses []Chat
}
func NewChatHistory ¶
func NewChatHistory() ChatHistory
func (*ChatHistory) AddChat ¶
func (c *ChatHistory) AddChat(chat Chat)
*
- Adds a chat to the chat history.
- The chat can can still be incomplete, but it must have at least a question.
- The answer will be added later by the model.
func (*ChatHistory) Clear ¶
func (c *ChatHistory) Clear()
func (*ChatHistory) LastAnswer ¶
func (c *ChatHistory) LastAnswer() string
func (ChatHistory) LastChat ¶
func (c ChatHistory) LastChat() (Chat, bool)
Returns the last chat in the chat history. If there are no responses, it returns false with empty Chat.
func (*ChatHistory) LastQuestion ¶
func (c *ChatHistory) LastQuestion() string
func (*ChatHistory) Len ¶
func (c *ChatHistory) Len() int
func (*ChatHistory) SetNewAnswerToLastChat ¶
func (c *ChatHistory) SetNewAnswerToLastChat(answer string)
Click to show internal directories.
Click to hide internal directories.