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 ¶
View Source
var (
ErrChatMessages = errors.New("unable to convert chat messages")
)
Functions ¶
This section is empty.
Types ¶
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
func New ¶
func New(promptMessages ...PromptMessage) *Chat
func (*Chat) PromptMessages ¶
func (c *Chat) PromptMessages() PromptMessages
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.