anthropic

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 New

func New(options Options) (*Provider, error)

New creates an Anthropic provider.

func (*Provider) StreamCompletion

func (provider *Provider) StreamCompletion(
	ctx context.Context,
	request zeroruntime.CompletionRequest,
) (<-chan zeroruntime.StreamEvent, error)

StreamCompletion sends one streaming Anthropic Messages request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL