Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultModel = Claude4Sonnet // See https://docs.anthropic.com/en/docs/about-claude/models/all-models for // current maximums. There's currently a flag to enable 128k output (output-128k-2025-02-19) DefaultMaxTokens = 8192 APIKeyEnv = "ANTHROPIC_API_KEY" DefaultURL = "https://api.anthropic.com/v1/messages" )
View Source
const ( Claude35Sonnet = "claude-3-5-sonnet-20241022" Claude35Haiku = "claude-3-5-haiku-20241022" Claude37Sonnet = "claude-3-7-sonnet-20250219" Claude4Sonnet = "claude-sonnet-4-20250514" Claude4Opus = "claude-opus-4-20250514" )
Variables ¶
This section is empty.
Functions ¶
func ClaudeModelName ¶ added in v0.0.23
ClaudeModelName returns the Anthropic Claude model name for userName. It returns an empty string if userName is not a recognized Claude model.
func IsClaudeModel ¶ added in v0.0.23
IsClaudeModel reports whether userName is a user-friendly Claude model. It uses ClaudeModelName under the hood.
Types ¶
type Service ¶
type Service struct {
HTTPC *http.Client // defaults to http.DefaultClient if nil
URL string // defaults to DefaultURL if empty
APIKey string // must be non-empty
Model string // defaults to DefaultModel if empty
MaxTokens int // defaults to DefaultMaxTokens if zero
DumpLLM bool // whether to dump request/response text to files for debugging; defaults to false
}
Service provides Claude completions. Fields should not be altered concurrently with calling any method on Service.
func (*Service) TokenContextWindow ¶
TokenContextWindow returns the maximum token context window size for this service
Click to show internal directories.
Click to hide internal directories.