Documentation
¶
Index ¶
Constants ¶
View Source
const BASEURL = "https://api.openai.com/v1/"
Variables ¶
This section is empty.
Functions ¶
func Completions ¶
Completions gtp文本模型回复 curl https://api.openai.com/v1/completions -H "Content-Type: application/json" -H "Authorization: Bearer your chatGPT key" -d '{"model": "text-davinci-003", "prompt": "give me good song", "temperature": 0, "max_tokens": 7}'
Types ¶
type ChatGPTRequestBody ¶
type ChatGPTRequestBody struct { Model string `json:"model"` Prompt string `json:"prompt"` MaxTokens int `json:"max_tokens"` Temperature float32 `json:"temperature"` TopP int `json:"top_p"` FrequencyPenalty int `json:"frequency_penalty"` PresencePenalty int `json:"presence_penalty"` }
ChatGPTRequestBody 响应体
type ChatGPTResponseBody ¶
type ChatGPTResponseBody struct { ID string `json:"id"` Object string `json:"object"` Created int `json:"created"` Model string `json:"model"` Choices []map[string]interface{} `json:"choices"` Usage map[string]interface{} `json:"usage"` }
ChatGPTResponseBody 请求体
type ChoiceItem ¶
type ChoiceItem struct { }
Click to show internal directories.
Click to hide internal directories.