Documentation ¶
Index ¶
Constants ¶
View Source
const ( ChatURL = "https://api.openai.com/v1/chat/completions" PhotoURL = "https://api.openai.com/v1/images/generations" )
Variables ¶
This section is empty.
Functions ¶
func NewPhotoQuerier ¶
func NewPhotoQuerier(pConf photo.Configurations) (models.Querier, error)
func NewTextQuerier ¶
func NewTextQuerier(conf text.Configurations) (models.ChatQuerier, error)
NewTextQuerier returns a new ChatGPT querier using the textconfigurations to load the correct model. API key is fetched via environment variable
Types ¶
type ChatCompletion ¶
type ChatGPT ¶
type ChatGPT struct { Model string `json:"model"` FrequencyPenalty float32 `json:"frequency_penalty"` MaxTokens *int `json:"max_tokens"` // Use a pointer to allow null value PresencePenalty float32 `json:"presence_penalty"` Temperature float32 `json:"temperature"` TopP float32 `json:"top_p"` Url string `json:"url"` Raw bool `json:"raw"` // contains filtered or unexported fields }
func (*ChatGPT) Query ¶
Query performs a streamCompletion and appends the returned message to it's internal chat. Then it stores the internal chat as prevQuery.json, so that it may be used n upcoming queries
type DallE ¶
type DallE struct { Model string `json:"model"` N int `json:"n"` Size string `json:"size"` Quality string `json:"quality"` Style string `json:"style"` Output photo.Output `json:"output"` // Don't save this as this is set via the Output struct ResponseFormat string `json:"-"` Prompt string `json:"-"` // contains filtered or unexported fields }
type DallERequest ¶
type ImageResponse ¶
type ImageResponses ¶
type ImageResponses struct { Created int `json:"created"` Data []ImageResponse `json:"data"` }
Click to show internal directories.
Click to hide internal directories.