Documentation ¶
Index ¶
- Constants
- Variables
- func IsChatModel(model string) bool
- type Client
- func (c *Client) GetChatCompletion(ctx context.Context, options CompletionOptions, prompt string) (string, error)
- func (c *Client) GetCompletion(ctx context.Context, options CompletionOptions, prompt string) (string, error)
- func (c *Client) GetImage(ctx context.Context, options ImageOptions, prompt string) ([]string, error)
- type CompletionOptions
- type ImageOptions
Constants ¶
View Source
const ( ImageURL = "ImageURL" ImageData = "ImageData" )
Variables ¶
View Source
var ( DefaultModel = strings.Clone(openai.GPT3Dot5Turbo) DefaultImageSize = strings.Clone(openai.CreateImageSize256x256) ErrMissingAPIKey = fmt.Errorf("%s env variable is not set", envKeyOpenAIApi) ErrModelCurieSize = fmt.Errorf("model %s must not have more than 1024 in total", openai.GPT3TextCurie001) ErrChatNotSupported = errors.New("chat is not supported for this model") ErrModifierNotSupported = errors.New("modifier is not supported for this model") )
View Source
var SupportedModels = []string{
openai.GPT4,
openai.GPT40314,
openai.GPT432K,
openai.GPT432K0314,
openai.GPT3Dot5Turbo0301,
openai.GPT3Dot5Turbo,
openai.GPT3TextDavinci003,
openai.GPT3TextDavinci002,
openai.GPT3TextCurie001,
openai.GPT3TextBabbage001,
openai.GPT3TextAda001,
openai.GPT3TextDavinci001,
openai.GPT3DavinciInstructBeta,
openai.GPT3Davinci,
openai.GPT3CurieInstructBeta,
openai.GPT3Curie,
openai.GPT3Ada,
openai.GPT3Babbage,
}
Functions ¶
func IsChatModel ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func CreateClient ¶
func (*Client) GetChatCompletion ¶
func (*Client) GetCompletion ¶
type CompletionOptions ¶
type ImageOptions ¶
Click to show internal directories.
Click to hide internal directories.