anthropic

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package anthropic provides an AIProvider implementation for the Anthropic Claude API. It wraps the HTTP patterns from ai/llm/client.go into the pluggable AIProvider interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey  string `yaml:"api_key"` //nolint:gosec // G117: config field
	Model   string // Defaults to claude-sonnet-4-20250514
	BaseURL string // Defaults to https://api.anthropic.com
}

Config holds configuration for the Anthropic provider.

type Provider

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

Provider implements ai.AIProvider for Anthropic's Claude models.

func New

func New(cfg Config) (*Provider, error)

New creates a new Anthropic AIProvider.

func (*Provider) Complete

func (*Provider) CompleteStream

func (p *Provider) CompleteStream(_ context.Context, _ ai.CompletionRequest) (<-chan ai.StreamChunk, error)

func (*Provider) Models

func (p *Provider) Models() []ai.ModelInfo

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) SupportsToolUse

func (p *Provider) SupportsToolUse() bool

func (*Provider) ToolComplete

Jump to

Keyboard shortcuts

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