Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultModel specifies the default language model used for generating // completions. DefaultModel = openai.GPT3Dot5Turbo // DefaultMaxTokens specifies the default maximum number of tokens for a // request. DefaultMaxTokens = 512 )
Variables ¶
This section is empty.
Functions ¶
func ChatTokens ¶ added in v0.0.4
ChatTokens calculates the total number of tokens used by a list of openai.ChatCompletionMessage for a given model.
func MaxTokensForModel ¶ added in v0.0.4
MaxTokensForModel retrieves the maximum number of tokens allowed for a specified model.
Types ¶
type Option ¶
type Option func(*Service)
Option modifies the configuration of a Service.
func Client ¶ added in v0.0.4
func Client(c *openai.Client) Option
Client sets the *openai.Client for the Service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides functionalities for generating text completions using OpenAI models, with options to customize the model, maximum tokens, and logging behavior.
Click to show internal directories.
Click to hide internal directories.