Documentation
¶
Overview ¶
Package chat provides a chat prompt template. Sometimes you need to define a chat prompt, this package provides a way to do that.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶
type Chat struct {
PromptMessages PromptMessages
}
func New ¶
func New(promptMessages PromptMessages) *Chat
func (*Chat) AddMessagePromptTemplate ¶
func (p *Chat) AddMessagePromptTemplate(message PromptMessage)
func (*Chat) ToMessages ¶
ToMessages converts the chat prompt template to a list of messages.
type Message ¶
type Message struct { Type MessageType Content string }
type MessageType ¶
type MessageType string
const ( MessageTypeSystem MessageType = "system" MessageTypeUser MessageType = "user" MessageTypeAssistant MessageType = "assistant" )
type PromptMessage ¶
type PromptMessage struct { Type MessageType Prompt Prompt }
type PromptMessages ¶
type PromptMessages []PromptMessage
Click to show internal directories.
Click to hide internal directories.