anthropic

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

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
}

func New

func New(opts ...Option) (c *Client, err error)

New creates a new Client instance with the provided options.

func (*Client) Completion

func (c *Client) Completion(ctx context.Context, content string) (*core.Response, error)

Completion is a method on the Client struct that takes a context.Context and a string argument

func (*Client) GetSummaryPrefix

func (c *Client) GetSummaryPrefix(ctx context.Context, content string) (*core.Response, error)

GetSummaryPrefix is an API call to get a summary prefix using function call.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is an interface that specifies instrumentation configuration options.

func WithAPIKey

func WithAPIKey(val string) Option

WithAPIKey is a function that returns an Option, which sets the token field of the config struct.

func WithMaxTokens

func WithMaxTokens(val int) Option

WithMaxTokens returns a new Option that sets the max tokens for the client configuration. The maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.

func WithModel

func WithModel(val string) Option

WithModel is a function that returns an Option, which sets the model field of the config struct.

func WithProxyURL

func WithProxyURL(val string) Option

WithProxyURL is a function that returns an Option, which sets the proxyURL field of the config struct.

func WithSkipVerify

func WithSkipVerify(val bool) Option

WithSkipVerify returns a new Option that sets the skipVerify for the client configuration.

func WithSocksURL

func WithSocksURL(val string) Option

WithSocksURL is a function that returns an Option, which sets the socksURL field of the config struct.

func WithTemperature

func WithTemperature(val float32) Option

WithTemperature returns a new Option that sets the temperature for the client configuration. What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

func WithTimeout

func WithTimeout(val time.Duration) Option

WithTimeout returns a new Option that sets the timeout for the client configuration. It takes a time.Duration value representing the timeout duration. It returns an optionFunc that sets the timeout field of the configuration to the provided value.

func WithTopP

func WithTopP(val float32) Option

WithTopP returns a new Option that sets the topP for the client configuration.

Jump to

Keyboard shortcuts

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