Documentation
¶
Index ¶
Constants ¶
View Source
const MaxTokensGpt35Turbo = 4096
View Source
const ModelGpt35Turbo = "gpt-3.5-turbo"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type ClientOptions ¶
type ClientOptions struct {
// HTTP transport
Transport http.RoundTripper
// Base url of OpenAI API
URL string
}
ClientOptions contains parameters for Client initialization
type OptionFunc ¶
type OptionFunc func(opts *ClientOptions) error
func WithTransport ¶
func WithTransport(transport http.RoundTripper) OptionFunc
WithTransport allows to override default client HTTP transport
func WithURL ¶
func WithURL(baseURL string) OptionFunc
WithURL allows to override base url of OpenAPI
type Request ¶
type Request struct {
Model ModelType `json:"model"`
Messages []*Message `json:"messages"`
Temperature float64 `json:"temperature,omitempty"`
TopP float64 `json:"top_p,omitempty"`
N int `json:"n,omitempty"`
Stream bool `json:"stream,omitempty"`
Stop interface{} `json:"stop,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
PresencePenalty float64 `json:"presence_penalty,omitempty"`
FrequencyPenalty float64 `json:"frequency_penalty,omitempty"`
LogitBias interface{} `json:"logit_bias,omitempty"`
User string `json:"user,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.