anthropic

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Name                = "anthropic"
	DefaultAnthropicURL = "https://api.anthropic.com"
	ClaudeAIBaseURL     = "https://claude.ai"
	AnthropicVersion    = "2023-06-01"
)

Variables

View Source
var (
	ErrSnapshotRefreshRequired       = oauthrefresh.ErrSnapshotRefreshRequired
	ErrCredentialPersistenceDegraded = oauthrefresh.ErrCredentialPersistenceDegraded
)

Functions

func Register

func Register(reg *adapter.Registry, client *http.Client) error

func RegisterWithAuth

func RegisterWithAuth(reg *adapter.Registry, client *http.Client, sink CredentialSink, refresh SnapshotRefreshTrigger) error

RegisterWithAuth re-registers the anthropic adapter with OAuth token refresh enabled (used by the gateway once the control plane is reachable).

Types

type Adapter

type Adapter struct {
	Client *http.Client
	// contains filtered or unexported fields
}

func New

func New(client *http.Client) *Adapter

func NewWithAuth

func NewWithAuth(client *http.Client, sink CredentialSink, refresh SnapshotRefreshTrigger) *Adapter

NewWithAuth enables OAuth token refresh (claude.ai browser login). The sink persists refreshed credentials to the control plane; refresh triggers a snapshot re-adoption on revision conflicts. A nil sink still allows in-memory refresh.

func (*Adapter) Execute

func (a *Adapter) Execute(ctx context.Context, ex adapter.Execution) (*adapter.Result, error)

func (*Adapter) Operate

type ControlPlaneSink

type ControlPlaneSink = oauthrefresh.ControlPlaneSink

type CredentialPersistResult

type CredentialPersistResult = oauthrefresh.CredentialPersistResult

type CredentialSink

type CredentialSink = oauthrefresh.CredentialSink

type SnapshotRefreshTrigger

type SnapshotRefreshTrigger = oauthrefresh.SnapshotRefreshTrigger

Jump to

Keyboard shortcuts

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