anthropic

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvAnthropicAPIKey = "ANTHROPIC_API_KEY"
)

Environment variable names for Anthropic configuration.

Variables

This section is empty.

Functions

func DefaultOptions added in v0.12.0

func DefaultOptions() []llm.Option

DefaultOptions returns the default options for Anthropic.

func MaybeRegister added in v0.13.0

func MaybeRegister(reg *llm.Registry)

MaybeRegister registers available Anthropic providers:

  • Anthropic API provider if ANTHROPIC_API_KEY is set
  • Claude Code profile provider if $HOME/.claude/.credentials.json exists

Types

type ClaudeProvider added in v0.15.1

type ClaudeProvider struct {
	// contains filtered or unexported fields
}

ClaudeProvider implements Anthropic requests with Claude Code credentials/profile.

func NewClaudeCodeProvider

func NewClaudeCodeProvider(opts ...llm.Option) *ClaudeProvider

NewClaudeCodeProvider creates a Claude Code profile provider.

func (*ClaudeProvider) CreateStream added in v0.15.1

func (p *ClaudeProvider) CreateStream(ctx context.Context, opts llm.StreamOptions) (<-chan llm.StreamEvent, error)

func (*ClaudeProvider) Models added in v0.15.1

func (p *ClaudeProvider) Models() []llm.Model

func (*ClaudeProvider) Name added in v0.15.1

func (p *ClaudeProvider) Name() string

type OAuthConfig added in v0.12.0

type OAuthConfig struct {
	Access  string
	Refresh string
	Expires int64
}

OAuthConfig holds OAuth token information for Claude Code authentication.

func (*OAuthConfig) IsExpired added in v0.15.1

func (o *OAuthConfig) IsExpired() bool

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements the direct Anthropic API backend.

func New

func New(opts ...llm.Option) *Provider

New creates a new Anthropic provider.

func (*Provider) CreateStream

func (p *Provider) CreateStream(ctx context.Context, opts llm.StreamOptions) (<-chan llm.StreamEvent, error)

func (*Provider) Models

func (p *Provider) Models() []llm.Model

func (*Provider) Name

func (p *Provider) Name() string

Jump to

Keyboard shortcuts

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