Documentation
¶
Index ¶
- Constants
- func IsModelSupported(model string) bool
- func Metadata() provider.Metadata
- func Models() []string
- func New(cfg config.ProviderConfig) (provider.Provider, error)
- type Client
- func (c *Client) ContextWindow(model string) int
- func (c *Client) DefaultModel() string
- func (c *Client) EstimateTokens(s string) int
- func (c *Client) Name() string
- func (c *Client) Pricing(model string) provider.Pricing
- func (c *Client) Review(ctx context.Context, req provider.Request) (provider.Response, error)
- func (c *Client) SetTimeout(d time.Duration)
- func (c *Client) TestConnection(ctx context.Context) error
Constants ¶
const ( Name = "anthropic" ModelOpus48 = "claude-opus-4-8" ModelSonnet46 = "claude-sonnet-4-6" ModelHaiku45 = "claude-haiku-4-5-20251001" DefaultModel = ModelOpus48 )
Variables ¶
This section is empty.
Functions ¶
func IsModelSupported ¶
func Metadata ¶ added in v1.17.0
Metadata describes anthropic without needing a credential, so documentation can list every model, context window and price for a reader who has never configured this provider. See ADR-0039.
Every field is derived from this package's own tables — supportedModels for the set and its order, contextWindowFor and pricingFor for the numbers — so adding a model there surfaces it here automatically. A hand-written literal would just relocate the duplication.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ContextWindow ¶
func (*Client) DefaultModel ¶
func (*Client) EstimateTokens ¶
func (*Client) SetTimeout ¶ added in v1.16.0
SetTimeout implements provider.TimeoutSetter. The SDK derives its own non-streaming timeout from max_tokens and caps it at 10 minutes — worse, it refuses outright ("streaming is required for operations that may take longer than 10 minutes") rather than waiting. Passing an explicit request timeout short-circuits that calculation, so a user who allows 20 minutes actually gets them. A non-positive d is ignored.