Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var APIKeyMeta = provider.ProviderMeta{ Provider: provider.ProviderAnthropic, AuthMethod: provider.AuthAPIKey, EnvVars: []string{"ANTHROPIC_API_KEY"}, DisplayName: "Direct API", }
APIKeyMeta is the metadata for Anthropic via API Key
var VertexMeta = provider.ProviderMeta{ Provider: provider.ProviderAnthropic, AuthMethod: provider.AuthVertex, EnvVars: []string{"CLOUD_ML_REGION", "ANTHROPIC_VERTEX_PROJECT_ID"}, DisplayName: "Vertex AI", }
VertexMeta is the metadata for Anthropic via Vertex AI
Functions ¶
func NewAPIKeyClient ¶
func NewAPIKeyClient(ctx context.Context) (provider.LLMProvider, error)
NewAPIKeyClient creates a new Anthropic client using API Key authentication
func NewVertexClient ¶
func NewVertexClient(ctx context.Context) (provider.LLMProvider, error)
NewVertexClient creates a new Anthropic client using Vertex AI authentication
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the LLMProvider interface using the Anthropic SDK
func (*Client) ListModels ¶
ListModels returns available models using the Anthropic Models API, falling back to a static list if the API call fails.
func (*Client) Stream ¶
func (c *Client) Stream(ctx context.Context, opts provider.CompletionOptions) <-chan provider.StreamChunk
Stream sends a completion request and returns a channel of streaming chunks
type VertexClient ¶ added in v1.3.1
type VertexClient struct {
*Client
}
VertexClient wraps the standard Client with Vertex-specific behavior
func (*VertexClient) ListModels ¶ added in v1.3.1
ListModels tries the Anthropic Models API first, falling back to a static list with a warning error when the API is unavailable (e.g. 404 on Vertex AI).