anthropic

package
v1.4.239 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RefreshToken added in v1.4.231

func RefreshToken() (string, error)

RefreshToken refreshes an expired OAuth token using the refresh token

func RunOAuthFlow added in v1.4.231

func RunOAuthFlow() (token string, err error)

RunOAuthFlow executes the complete OAuth authorization flow

Types

type Client

type Client struct {
	*plugins.PluginBase
	ApiBaseURL *plugins.SetupQuestion
	ApiKey     *plugins.SetupQuestion
	UseOAuth   *plugins.SetupQuestion
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (ret *Client)

func (*Client) IsConfigured added in v1.4.238

func (an *Client) IsConfigured() bool

IsConfigured returns true if either the API key or OAuth is configured

func (*Client) ListModels

func (an *Client) ListModels() (ret []string, err error)

func (*Client) NeedsRawMode added in v1.4.192

func (an *Client) NeedsRawMode(modelName string) bool

func (*Client) Send

func (an *Client) Send(ctx context.Context, msgs []*chat.ChatCompletionMessage, opts *common.ChatOptions) (
	ret string, err error)

func (*Client) SendStream

func (an *Client) SendStream(
	msgs []*chat.ChatCompletionMessage, opts *common.ChatOptions, channel chan string,
) (err error)

func (*Client) Setup added in v1.4.231

func (an *Client) Setup() (err error)

type OAuthTransport added in v1.4.231

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

OAuthTransport is a custom HTTP transport that adds OAuth Bearer token and beta header

func NewOAuthTransport added in v1.4.231

func NewOAuthTransport(client *Client, base http.RoundTripper) *OAuthTransport

NewOAuthTransport creates a new OAuth transport for the given client

func (*OAuthTransport) RoundTrip added in v1.4.231

func (t *OAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the http.RoundTripper interface

Jump to

Keyboard shortcuts

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