Documentation
¶
Index ¶
- type APIMessage
- type Client
- type ContentBlock
- type CreateRequest
- type InputSchema
- type Message
- type MessageParam
- type Provider
- func (p *Provider) CreateMessage(ctx context.Context, prompt string, messages []llm.Message, tools []llm.Tool) (llm.Message, error)
- func (p *Provider) CreateToolResponse(toolCallID string, content interface{}) (llm.Message, error)
- func (p *Provider) Name() string
- func (p *Provider) SupportsTools() bool
- type Tool
- type ToolCall
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIMessage ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateMessage ¶
func (c *Client) CreateMessage(ctx context.Context, req CreateRequest) (*APIMessage, error)
type ContentBlock ¶
type ContentBlock struct { Type string `json:"type"` Text string `json:"text,omitempty"` ID string `json:"id,omitempty"` ToolUseID string `json:"tool_use_id,omitempty"` Name string `json:"name,omitempty"` Input json.RawMessage `json:"input,omitempty"` Content interface{} `json:"content,omitempty"` }
type CreateRequest ¶
type CreateRequest struct { Model string `json:"model"` Messages []MessageParam `json:"messages"` MaxTokens int `json:"max_tokens"` System string `json:"system,omitempty"` Tools []Tool `json:"tools,omitempty"` }
type InputSchema ¶
type Message ¶
type Message struct {
Msg APIMessage
}
Message implements the llm.Message interface
func (*Message) GetContent ¶
func (*Message) GetToolCalls ¶
func (*Message) GetToolResponseID ¶
func (*Message) IsToolResponse ¶
type MessageParam ¶
type MessageParam struct { Role string `json:"role"` Content []ContentBlock `json:"content"` }
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func NewProvider ¶
func (*Provider) CreateMessage ¶
func (*Provider) CreateToolResponse ¶
func (*Provider) SupportsTools ¶
type Tool ¶
type Tool struct { Name string `json:"name"` Description string `json:"description"` InputSchema InputSchema `json:"input_schema"` }
type ToolCall ¶
type ToolCall struct {
// contains filtered or unexported fields
}
ToolCall implements the llm.ToolCall interface
func (*ToolCall) GetArguments ¶
Click to show internal directories.
Click to hide internal directories.