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