anthropic

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnthropicAPIURL is the base URL for the Anthropic API
	AnthropicAPIURL = "https://api.anthropic.com/v1"

	// AnthropicAPIVersion is the API version header value
	AnthropicAPIVersion = "2023-06-01"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnthropicProvider

type AnthropicProvider struct {
	*provider.BaseProvider
	// contains filtered or unexported fields
}

AnthropicProvider implements the Provider interface for Anthropic's Claude API

func NewAnthropicProvider

func NewAnthropicProvider(config Config) (*AnthropicProvider, error)

NewAnthropicProvider creates a new Anthropic provider instance

func (*AnthropicProvider) Chat

Chat sends a chat request to the Anthropic API

func (*AnthropicProvider) Close

func (a *AnthropicProvider) Close() error

Close releases resources held by the provider

func (*AnthropicProvider) Models

func (a *AnthropicProvider) Models() []string

Models returns the list of supported models

func (*AnthropicProvider) Name

func (a *AnthropicProvider) Name() string

Name returns the provider name

func (*AnthropicProvider) Stream

func (a *AnthropicProvider) Stream(ctx context.Context, messages []provider.Message, opts ...provider.StreamOption) (<-chan provider.Event, error)

Stream sends a streaming chat request to the Anthropic API

type Config

type Config struct {
	APIKey     string
	BaseURL    string
	HTTPClient *http.Client
	Logger     logger.LoggerInterface
}

Config contains configuration for the Anthropic provider

Jump to

Keyboard shortcuts

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