Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatCompletionRequest ¶
type ChatCompletionRequest struct {
Model string `json:"model"`
Messages []Message `json:"messages"`
Temperature float64 `json:"temperature,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
Stream bool `json:"stream,omitempty"`
}
ChatCompletionRequest represents a chat completion request
type ChatCompletionResponse ¶
type ChatCompletionResponse struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
Choices []Choice `json:"choices"`
Usage Usage `json:"usage"`
}
ChatCompletionResponse represents a chat completion response
type Choice ¶
type Choice struct {
Index int `json:"index"`
Message Message `json:"message"`
FinishReason string `json:"finish_reason"`
}
Choice represents a choice in the chat completion response
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements an LLM client for Anthropic
type Config ¶
type Config struct {
APIKey string
Model string
BaseURL string
Timeout time.Duration
MaxRetries int
Temperature float64
MaxTokens int
}
Config configures the Anthropic client
type Delta ¶
type Delta struct {
Content string `json:"content,omitempty"`
}
Delta represents a delta in the streaming response
type ErrorResponse ¶
type ErrorResponse struct {
Error Error `json:"error"`
}
ErrorResponse represents an error response
type StreamChoice ¶
type StreamChoice struct {
Index int `json:"index"`
Delta *Delta `json:"delta,omitempty"`
FinishReason string `json:"finish_reason,omitempty"`
}
StreamChoice represents a choice in the streaming response
type StreamChunk ¶
type StreamChunk struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
Choices []StreamChoice `json:"choices"`
}
StreamChunk represents a chunk in the streaming response
Click to show internal directories.
Click to hide internal directories.