Documentation ¶
Index ¶
Constants ¶
View Source
const ( ChatURL = "https://api.openai.com/v1/chat/completions" PhotoURL = "https://api.openai.com/v1/images/generations" )
Variables ¶
View Source
var GPT_DEFAULT = ChatGPT{ Model: "gpt-4-turbo", Temperature: 1.0, TopP: 1.0, Url: ChatURL, }
Functions ¶
func NewPhotoQuerier ¶
func NewPhotoQuerier(pConf photo.Configurations) (models.Querier, error)
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"` // contains filtered or unexported fields }
func (*ChatGPT) RegisterTool ¶ added in v1.2.8
func (*ChatGPT) StreamCompletions ¶ added in v1.2.1
func (g *ChatGPT) StreamCompletions(ctx context.Context, chat models.Chat) (chan models.CompletionEvent, error)
// streamCompletions taking the messages as prompt conversation. Returns the messages from the chat model.
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 GptTool ¶ added in v1.2.8
type GptTool struct { Name string `json:"name"` Description string `json:"description"` Inputs tools.InputSchema `json:"parameters"` }
type GptToolSuper ¶ added in v1.2.8
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.