Documentation
¶
Overview ¶
Package anthropicmessages is a reference client emulator for the Anthropic Messages API, built on github.com/anthropics/anthropic-sdk-go.
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 wraps the SDK Messages surface.
func (*Client) CreateMessage ¶
func (c *Client) CreateMessage(ctx context.Context, body anthropic.MessageNewParams) (*anthropic.Message, error)
CreateMessage calls POST /v1/messages (non-streaming).
func (*Client) CreateMessageStream ¶
func (c *Client) CreateMessageStream(ctx context.Context, body anthropic.MessageNewParams) *ssestream.Stream[anthropic.MessageStreamEventUnion]
CreateMessageStream calls /v1/messages with stream: true.
type Config ¶
type Config struct {
BaseURL string
APIKey string
HTTPClient *http.Client
// DisableSDKRetries, when true, sets MaxRetries to 0 for deterministic refbackend errors.
DisableSDKRetries bool
}
Config configures the official Anthropic Go client. BaseURL is the API origin only (for example https://api.anthropic.com); the SDK posts to /v1/messages relative to it.
Click to show internal directories.
Click to hide internal directories.