Skip to content

Commit 7f80303

Browse files
authored
Fix max_completion_tokens (#860)
The json tag is incorrect, and results in an error from the API when using the o1 model. I didn't modify the struct field name to maintain compatibility if anyone else had started using it, but it wouldn't work for them either.
1 parent 38bdc81 commit 7f80303

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ type ChatCompletionRequest struct {
209209
MaxTokens int `json:"max_tokens,omitempty"`
210210
// MaxCompletionsTokens An upper bound for the number of tokens that can be generated for a completion,
211211
// including visible output tokens and reasoning tokens https://platform.openai.com/docs/guides/reasoning
212-
MaxCompletionsTokens int `json:"max_completions_tokens,omitempty"`
212+
MaxCompletionsTokens int `json:"max_completion_tokens,omitempty"`
213213
Temperature float32 `json:"temperature,omitempty"`
214214
TopP float32 `json:"top_p,omitempty"`
215215
N int `json:"n,omitempty"`

0 commit comments

Comments
 (0)