anthropicmessages

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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 New

func New(cfg Config) *Client

New builds a Messages API reference client.

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

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.

Jump to

Keyboard shortcuts

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