Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaultConfig ¶
func SetDefaultConfig(cfg Config)
SetDefaultConfig sets the instance-wide LLM settings (the `llm` block of the configuration). Fields an agent leaves empty fall back to them.
Types ¶
type Client ¶
type Client interface {
Chat(ctx context.Context, messages []Message, opts ...Option) (*Response, error)
}
Client is the interface that all LLM providers must implement.
func NewAdapter ¶
NewAdapter creates a new `Client` by wrapping the specified LLM provider. Empty fields are filled from SetDefaultConfig.
type Message ¶
type Message struct {
Role Role `json:"role"`
Content string `json:"content"`
ToolCallID string `json:"tool_call_id,omitempty"`
ToolCall *llms.ToolCall `json:"tool_call,omitempty"`
}
Message represents a single message in a conversation.
type Option ¶
type Option func(*options)
Option is a functional option for the Chat method.
func WithToolChoice ¶
WithToolChoice sets the tool choice option for the LLM call.
type Response ¶
type Response struct {
Type ResponseType
Content string
ToolCall *llms.ToolCall
}
Response represents the output from an LLM chat call.
type ResponseType ¶
type ResponseType string
ResponseType indicates the type of the LLM's response.
const ( ResponseTypeText ResponseType = "text" ResponseTypeToolCall ResponseType = "tool_call" )