@@ -138,25 +138,26 @@ func checkPromptType(prompt any) bool {
138
138
139
139
// CompletionRequest represents a request structure for completion API.
140
140
type CompletionRequest struct {
141
- Model string `json:"model"`
142
- Prompt any `json:"prompt,omitempty"`
143
- Suffix string `json:"suffix,omitempty"`
144
- MaxTokens int `json:"max_tokens,omitempty"`
145
- Temperature float32 `json:"temperature,omitempty"`
146
- TopP float32 `json:"top_p,omitempty"`
147
- N int `json:"n,omitempty"`
148
- Stream bool `json:"stream,omitempty"`
149
- LogProbs int `json:"logprobs,omitempty"`
150
- Echo bool `json:"echo,omitempty"`
151
- Stop []string `json:"stop,omitempty"`
152
- PresencePenalty float32 `json:"presence_penalty,omitempty"`
153
- FrequencyPenalty float32 `json:"frequency_penalty,omitempty"`
154
- BestOf int `json:"best_of,omitempty"`
141
+ Model string `json:"model"`
142
+ Prompt any `json:"prompt,omitempty"`
143
+ BestOf int `json:"best_of,omitempty"`
144
+ Echo bool `json:"echo,omitempty"`
145
+ FrequencyPenalty float32 `json:"frequency_penalty,omitempty"`
155
146
// LogitBias is must be a token id string (specified by their token ID in the tokenizer), not a word string.
156
147
// incorrect: `"logit_bias":{"You": 6}`, correct: `"logit_bias":{"1639": 6}`
157
148
// refs: https://platform.openai.com/docs/api-reference/completions/create#completions/create-logit_bias
158
- LogitBias map [string ]int `json:"logit_bias,omitempty"`
159
- User string `json:"user,omitempty"`
149
+ LogitBias map [string ]int `json:"logit_bias,omitempty"`
150
+ LogProbs int `json:"logprobs,omitempty"`
151
+ MaxTokens int `json:"max_tokens,omitempty"`
152
+ N int `json:"n,omitempty"`
153
+ PresencePenalty float32 `json:"presence_penalty,omitempty"`
154
+ Seed * int `json:"seed,omitempty"`
155
+ Stop []string `json:"stop,omitempty"`
156
+ Stream bool `json:"stream,omitempty"`
157
+ Suffix string `json:"suffix,omitempty"`
158
+ Temperature float32 `json:"temperature,omitempty"`
159
+ TopP float32 `json:"top_p,omitempty"`
160
+ User string `json:"user,omitempty"`
160
161
}
161
162
162
163
// CompletionChoice represents one of possible completions.
0 commit comments