anthropic

package
v0.0.0-...-5c6d8ba Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchAdapter

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

func NewBatchAdapter

func NewBatchAdapter(client *Client, provider string) *BatchAdapter

func (*BatchAdapter) Cancel

func (a *BatchAdapter) Cancel(ctx context.Context, providerJobID string) error

func (*BatchAdapter) Create

func (*BatchAdapter) Get

func (a *BatchAdapter) Get(ctx context.Context, providerJobID string) (*modality.BatchStatus, error)

func (*BatchAdapter) Output

func (a *BatchAdapter) Output(ctx context.Context, providerJobID string) (io.ReadCloser, error)

type ChatAdapter

type ChatAdapter struct {
	*anthropiccompat.ChatAdapter
	// contains filtered or unexported fields
}

ChatAdapter is the shared Anthropic-compatible chat adapter with Anthropic's native extensions enabled (thinking budget, hosted tools, per-request beta headers) plus the native count_tokens endpoint. Complete/Stream and the native CreateMessage/StreamMessage passthrough are inherited from the compat adapter.

func NewChatAdapter

func NewChatAdapter(client *Client, model string, defaultMaxTokens int) *ChatAdapter

func (*ChatAdapter) CountTokens

CountTokens uses Anthropic's native /v1/messages/count_tokens endpoint.

type Client

type Client struct {
	*anthropiccompat.Client
}

Client is the native Anthropic client: the shared Anthropic-compatible transport configured with Anthropic's x-api-key + anthropic-version auth headers. Per-request anthropic-beta headers are supplied by the chat adapter through the compat client's JSONWithBetas/StreamWithBetas.

func NewClient

func NewClient(cfg config.ProviderConfig) *Client

type FilesAdapter

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

func NewFilesAdapter

func NewFilesAdapter(client *Client, provider string) *FilesAdapter

func (*FilesAdapter) Delete

func (a *FilesAdapter) Delete(ctx context.Context, providerFileID string) error

func (*FilesAdapter) Get

func (a *FilesAdapter) Get(ctx context.Context, providerFileID string) (*modality.ProviderFileHandle, error)

func (*FilesAdapter) Materialize

func (*FilesAdapter) Upload

Jump to

Keyboard shortcuts

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