Documentation
¶
Overview ¶
Package anthropic implements the LLM provider interface for Anthropic Claude models.
Index ¶
- type AnthropicAdapter
- func (a *AnthropicAdapter) Chat(ctx context.Context, req provider.ChatRequest) (*provider.ChatResponse, error)
- func (a *AnthropicAdapter) Models() []provider.ModelInfo
- func (a *AnthropicAdapter) Name() string
- func (a *AnthropicAdapter) Stream(ctx context.Context, req provider.ChatRequest) (<-chan provider.StreamChunk, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnthropicAdapter ¶
type AnthropicAdapter struct {
// contains filtered or unexported fields
}
AnthropicAdapter implements provider.Provider for Anthropic Claude models.
func New ¶
func New(apiKey string) *AnthropicAdapter
New creates a new Anthropic adapter with the given API key.
func (*AnthropicAdapter) Chat ¶
func (a *AnthropicAdapter) Chat(ctx context.Context, req provider.ChatRequest) (*provider.ChatResponse, error)
Chat sends a non-streaming request to the Anthropic Messages API.
func (*AnthropicAdapter) Models ¶
func (a *AnthropicAdapter) Models() []provider.ModelInfo
Models returns the list of supported Anthropic models.
func (*AnthropicAdapter) Name ¶
func (a *AnthropicAdapter) Name() string
Name returns the provider identifier.
func (*AnthropicAdapter) Stream ¶
func (a *AnthropicAdapter) Stream(ctx context.Context, req provider.ChatRequest) (<-chan provider.StreamChunk, error)
Stream sends a streaming request to the Anthropic Messages API. Returns a channel of StreamChunk that the caller can read from.
Click to show internal directories.
Click to hide internal directories.