Documentation ¶
Index ¶
Constants ¶
View Source
const ( GPT_35_TURBO_0125 = ModelID("gpt-3.5-turbo-0125") GPT_35_TURBO_INSTRUCT = ModelID("gpt-3.5-turbo-instruct") GPT_4 = ModelID("gpt-4") GPT_4_32K = ModelID("gpt-4-32k") GPT_4o = ModelID("gpt-4o") GPT_4o_MINI = ModelID("gpt-4o-mini") )
View Source
const Version = "openai/v0.0.4"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
OpenAI client
func New ¶
Creates OpenAI Chat (completion) client.
By default OpenAI reads access token from `~/.netrc`, supply custom secret `WithSecret(secret string)` if needed.
The client is configurable using
WithSecret(secret string) WithNetRC(host string) WithModel(...) WithHTTP(opts ...http.Config)
func (*Client) ConsumedTokens ¶
Number of tokens consumed within the session
type Option ¶
type Option func(*Client)
Config option for the client
func WithFormatter ¶ added in v0.0.4
Config Formatter
func WithQuotaTokensInReply ¶ added in v0.0.3
Config tokens quota in reply
Click to show internal directories.
Click to hide internal directories.