Documentation ¶
Index ¶
Constants ¶
View Source
const ( ApiKeyHeader = "x-api-key" AnthropicApiHeader = "anthropic-version" ContentTypeHeader = "content-type" DefaultApiVersion = "2023-06-01" MaxTokens = 4096 MaxRetries = 4 DefaultTemperature = 0.7 DefaultTimeoutSeconds = 45 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnthropicApiRequest ¶
type AnthropicApiRequest struct { Model string `json:"model"` Messages []Message `json:"messages"` MaxTokens int `json:"max_tokens,omitempty"` Temperature float64 `json:"temperature,omitempty"` System string `json:"system,omitempty"` }
AnthropicApiRequest represents the request structure for Claude API
type AnthropicApiResponse ¶
type AnthropicApiResponse struct { Id string `json:"id"` Type string `json:"type"` Role string `json:"role"` Content []Content `json:"content"` Model string `json:"model"` StopReason string `json:"stop_reason,omitempty"` Usage Usage `json:"usage"` }
AnthropicApiResponse represents the response structure from Claude API
type AnthropicClient ¶
type AnthropicClient struct {
// contains filtered or unexported fields
}
func NewAnthropicClient ¶
func NewAnthropicClient(cfg *config.GlobalConfig, model enum.AIModel) *AnthropicClient
type ErrorResponse ¶
Click to show internal directories.
Click to hide internal directories.