Documentation ¶
Index ¶
Constants ¶
View Source
const OpenAIBaseURL = "https://api.openai.com/v1/"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatGPTRequestBody ¶
type ChatGPTRequestBody struct { Model string `json:"model"` Prompt string `json:"prompt"` MaxTokens uint `json:"max_tokens"` Temperature float64 `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 []ChoiceItem `json:"choices"` Usage map[string]interface{} `json:"usage"` }
ChatGPTResponseBody 请求体
type ChoiceItem ¶
type GPTModel ¶
type GPTModel int
GPTModel 1 openai大模型 2 讯飞星火大模型
const ( OpenAIModel GPTModel SparkModel )
type GPTModelArg ¶
type GPTModelArg struct { Spark *SparkArg `json:"spark"` Openapi *OpenapiArg `json:"openapi"` }
type OpenapiArg ¶
type OpenapiArg struct { APIKey string `json:"api_key"` AutoPass bool `json:"auto_pass"` SessionTimeout time.Duration `json:"session_timeout"` MaxTokens uint `json:"max_tokens"` Model string `json:"model"` Temperature float64 `json:"temperature"` ReplyPrefix string `json:"reply_prefix"` SessionClearToken string `json:"session_clear_token"` }
Click to show internal directories.
Click to hide internal directories.