feat(AI): add salted user id

This commit is contained in:
Yiyang Kang 2023-03-21 13:35:25 +08:00
parent 816ae68aeb
commit b60be9ae7e
Signed by: kkyy
GPG key ID: 80FD317ECAF06CC3
2 changed files with 18 additions and 9 deletions

View file

@ -18,16 +18,16 @@ type ChatMessage struct {
type ChatRequest struct {
Model string `json:"model"`
Messages []ChatMessage `json:"messages"`
Temperature *float64 `json:"temperature,omitempty"`
TopP *float64 `json:"top_p,omitempty"`
N int `json:"n,omitempty"`
Stream bool `json:"stream,omitempty"`
Stop []string `json:"stop,omitempty"`
Temperature *float64 `json:"temperature,omitempty"` // What sampling temperature to use, between 0 and 2.
TopP *float64 `json:"top_p,omitempty"` // Nucleus sampling. Specify this or temperature but not both.
N int `json:"n,omitempty"` // How many chat completion choices to generate for each input message.
Stream bool `json:"stream,omitempty"` // If set, partial message deltas will be sent as data-only server-sent events as they become available.
Stop []string `json:"stop,omitempty"` // Up to 4 sequences where the API will stop generating further tokens.
MaxTokens int `json:"max_tokens,omitempty"`
PresencePenalty *float64 `json:"presence_penalty,omitempty"`
FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"`
LogitBias map[string]float64 `json:"logit_bias,omitempty"`
User string `json:"user,omitempty"`
PresencePenalty *float64 `json:"presence_penalty,omitempty"` // Number between -2.0 and 2.0.
FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"` // Number between -2.0 and 2.0.
LogitBias map[string]float64 `json:"logit_bias,omitempty"` // Modify the likelihood of specified tokens appearing in the completion.
User string `json:"user,omitempty"` // A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
}
type ChatResponseChoice struct {