Documentation
¶
Overview ¶
Package anthropic implements a agent.Provider for the Anthropic Claude API.
Index ¶
- type Config
- type Provider
- func (p *Provider) Chat(ctx context.Context, messages []agent.Message, tools []agent.ToolDef, ...) (agent.Response, error)
- func (p *Provider) ChatStartMetadata() (string, string, int)
- func (p *Provider) ChatStream(ctx context.Context, messages []agent.Message, tools []agent.ToolDef, ...) (<-chan agent.StreamDelta, error)
- func (p *Provider) SessionStartMetadata() (string, string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
APIKey string
Model string // e.g., "claude-sonnet-4-20250514"
BaseURL string
// QuotaSignalObserver, when set, receives a parsed Anthropic rate-limit
// signal on every HTTP response. The service layer wires this to the
// provider quota state machine so subscription/daily exhaustion routes
// dispatch around the provider until its reset window elapses.
QuotaSignalObserver func(quotaheaders.Signal)
}
Config holds configuration for the Anthropic provider.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements agent.Provider for the Anthropic Messages API.
func (*Provider) ChatStartMetadata ¶
ChatStartMetadata reports the resolved provider system and upstream server identity known when the provider is constructed.
func (*Provider) ChatStream ¶
func (p *Provider) ChatStream(ctx context.Context, messages []agent.Message, tools []agent.ToolDef, opts agent.Options) (<-chan agent.StreamDelta, error)
ChatStream implements agent.StreamingProvider for token-level streaming.
func (*Provider) SessionStartMetadata ¶
SessionStartMetadata reports the broad provider identity and configured model that should be recorded on session.start events.
Click to show internal directories.
Click to hide internal directories.