anthropic

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*core.BaseClient
}

Client is an Anthropic (Claude) LLM client.

It implements the core.Client interface and provides access to Anthropic's Claude models (Claude 3 Opus, Sonnet, Haiku, etc.).

The client handles Anthropic-specific API requirements including the anthropic-version header, x-api-key authentication, and Claude's unique message format with separate system prompts.

Tool calling is fully supported in both streaming and non-streaming modes, aligned with OpenAI/DeepSeek/Ollama provider behavior:

  • Tools are sent via the tools field (input_schema, not parameters)
  • Tool calls arrive as tool_use content blocks
  • Tool results are sent back as tool_result content blocks
  • Streaming uses content_block_start/delta/stop events
  • stop_reason "tool_use" is mapped to "tool_calls" for cross-provider parity

func NewAnthropic

func NewAnthropic(config core.Config) (*Client, error)

New creates a new Anthropic client

Jump to

Keyboard shortcuts

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