Documentation
¶
Index ¶
- type Client
- type Option
- func WithAPIKey(val string) Option
- func WithMaxTokens(val int) Option
- func WithModel(val string) Option
- func WithProxyURL(val string) Option
- func WithSkipVerify(val bool) Option
- func WithSocksURL(val string) Option
- func WithTemperature(val float32) Option
- func WithTimeout(val time.Duration) Option
- func WithTopP(val float32) Option
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 (*Client) Completion ¶
Completion is a method on the Client struct that takes a context.Context and a string argument
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is an interface that specifies instrumentation configuration options.
func WithAPIKey ¶
WithAPIKey is a function that returns an Option, which sets the token field of the config struct.
func WithMaxTokens ¶
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 ¶
WithModel is a function that returns an Option, which sets the model field of the config struct.
func WithProxyURL ¶
WithProxyURL is a function that returns an Option, which sets the proxyURL field of the config struct.
func WithSkipVerify ¶
WithSkipVerify returns a new Option that sets the skipVerify for the client configuration.
func WithSocksURL ¶
WithSocksURL is a function that returns an Option, which sets the socksURL field of the config struct.
func WithTemperature ¶
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 ¶
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.