Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnthropicClient ¶ added in v0.3.0
type AnthropicClient struct {
// contains filtered or unexported fields
}
func NewAnthropicClient ¶ added in v0.3.0
func NewAnthropicClient(apiKey string) *AnthropicClient
func (*AnthropicClient) CreateMessage ¶ added in v0.3.0
func (c *AnthropicClient) CreateMessage(ctx context.Context, req CreateMessageRequest) (*Message, error)
type ContentBlock ¶ added in v0.3.0
type ContentBlock struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
// For tool use blocks
ID string `json:"id,omitempty"`
ToolUseID string `json:"tool_use_id,omitempty"`
Name string `json:"name,omitempty"`
Input json.RawMessage `json:"input,omitempty"`
// For tool result blocks
Content interface{} `json:"content,omitempty"` // Can be string or []ContentBlock
}
type CreateMessageRequest ¶ added in v0.3.0
type CreateMessageRequest struct {
Model string `json:"model"`
Messages []MessageParam `json:"messages"`
MaxTokens int `json:"max_tokens"`
Tools []Tool `json:"tools,omitempty"`
}
type InputSchema ¶ added in v0.3.0
type MessageParam ¶ added in v0.3.0
type MessageParam struct {
Role string `json:"role"`
Content []ContentBlock `json:"content"`
}
type Tool ¶ added in v0.3.0
type Tool struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
InputSchema InputSchema `json:"input_schema"`
}
Click to show internal directories.
Click to hide internal directories.