Documentation
¶
Index ¶
- type Content
- type ContentType
- type Message
- type Role
- type Thread
- func (t *Thread) AddMessage(message *Message) *Thread
- func (t *Thread) AddMessages(messages ...*Message) *Thread
- func (t *Thread) ClearMessages() *Thread
- func (t *Thread) CountMessages() int
- func (t *Thread) LastMessage() *Message
- func (t *Thread) String() string
- func (t *Thread) UserQuery() []string
- type ToolCallData
- type ToolResponseData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶
type Content struct { Type ContentType Data any }
func NewImageContentFromURL ¶
func NewTextContent ¶
func NewToolCallContent ¶
func NewToolCallContent(data []ToolCallData) *Content
func NewToolResponseContent ¶
func NewToolResponseContent(toolResponseData ToolResponseData) *Content
func (*Content) AsToolCallData ¶
func (c *Content) AsToolCallData() []ToolCallData
func (*Content) AsToolResponseData ¶
func (c *Content) AsToolResponseData() *ToolResponseData
type ContentType ¶
type ContentType string
const ( ContentTypeText ContentType = "text" ContentTypeImage ContentType = "image" ContentTypeToolCall ContentType = "tool_call" ContentTypeToolResponse ContentType = "tool_response" )
type Message ¶
func NewAssistantMessage ¶
func NewAssistantMessage() *Message
func NewSystemMessage ¶
func NewSystemMessage() *Message
func NewToolMessage ¶
func NewToolMessage() *Message
func NewUserMessage ¶
func NewUserMessage() *Message
func (*Message) AddContent ¶
func (*Message) ClearContents ¶
type Thread ¶
type Thread struct {
Messages []*Message
}
func (*Thread) AddMessage ¶
func (*Thread) AddMessages ¶
func (*Thread) ClearMessages ¶
func (*Thread) CountMessages ¶
func (*Thread) LastMessage ¶
LastMessage returns the last message in the thread.
type ToolCallData ¶
type ToolResponseData ¶
Click to show internal directories.
Click to hide internal directories.