anthropic

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseURL string
	APIKey  string
}

Config configures the Anthropic provider.

type Provider

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

Provider implements providers.ProviderAdapter for Anthropic messages.

func New

func New(cfg Config) *Provider

New returns an Anthropic provider.

func (*Provider) API

func (p *Provider) API() string

API returns provider key.

func (*Provider) ListModels

func (p *Provider) ListModels(ctx context.Context) ([]ai.Model, error)

ListModels fetches available models from the Anthropic API.

func (*Provider) Stream

func (p *Provider) Stream(goCtx context.Context, model ai.Model, ctx ai.Context, opts ai.StreamOptions) (providers.AssistantEventStream, error)

Stream starts Anthropic message stream.

func (*Provider) StreamSimple

func (p *Provider) StreamSimple(goCtx context.Context, model ai.Model, ctx ai.Context, opts ai.SimpleStreamOptions) (providers.AssistantEventStream, error)

StreamSimple delegates to Stream with mapped options.

Jump to

Keyboard shortcuts

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