Documentation
¶
Index ¶
- Constants
- type AnthropicProvider
- func (a *AnthropicProvider) Chat(ctx context.Context, messages []provider.Message, opts ...provider.ChatOption) (provider.Response, error)
- func (a *AnthropicProvider) Close() error
- func (a *AnthropicProvider) Models() []string
- func (a *AnthropicProvider) Name() string
- func (a *AnthropicProvider) Stream(ctx context.Context, messages []provider.Message, ...) (<-chan provider.Event, error)
- type Config
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 ¶
func (a *AnthropicProvider) Chat(ctx context.Context, messages []provider.Message, opts ...provider.ChatOption) (provider.Response, error)
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
Click to show internal directories.
Click to hide internal directories.