Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
APIKey string
BaseURL string
Model string
MaxTokens int
Version string
Beta string
AuthHeader string
AuthScheme string
AuthHeaderValue string
CustomHeaders map[string]string
HTTPClient *http.Client
UserAgent string
// OAuthResolver, when set, supplies an OAuth bearer credential per request and
// is preferred over APIKey; a nil resolver (or one that yields ok=false) uses
// the API key. See providerio.SendWithAuthRetry.
OAuthResolver providerio.TokenResolver
// StreamIdleTimeout aborts the stream if no data arrives for this long.
// When unset, Zero uses providerio.ResolveStreamIdleTimeout — the
// ZERO_STREAM_IDLE_TIMEOUT override or providerio.DefaultStreamIdleTimeout.
StreamIdleTimeout time.Duration
SessionHeader string
}
Options configures an Anthropic Messages API provider.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider streams completions from Anthropic's Messages API.
func (*Provider) StreamCompletion ¶
func (provider *Provider) StreamCompletion( ctx context.Context, request zeroruntime.CompletionRequest, ) (<-chan zeroruntime.StreamEvent, error)
StreamCompletion sends one streaming Anthropic Messages request.
Click to show internal directories.
Click to hide internal directories.