anthropic

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 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 Client

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

Client implements llm.ChatModel for Anthropic's /v1/messages API.

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient constructs an Anthropic client with defaults.

func (*Client) Chat

Chat sends a message request to Anthropic and maps the response back to ChatResponse.

func (*Client) Name

func (c *Client) Name() string

func (*Client) StreamChat

func (c *Client) StreamChat(ctx context.Context, req protocol.ChatRequest) (protocol.ChatStream, error)

StreamChat uses SSE-style streaming from Anthropic messages endpoint.

type Config

type Config struct {
	APIKey     string
	BaseURL    string
	HTTPClient *http.Client
}

Config configures the Claude messages API client.

Jump to

Keyboard shortcuts

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