Skip to content

Commit

Permalink
Fix max_completion_tokens (#860)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexsacr authored Sep 26, 2024
1 parent 38bdc81 commit 7f80303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ type ChatCompletionRequest struct {
MaxTokens int `json:"max_tokens,omitempty"`
// MaxCompletionsTokens An upper bound for the number of tokens that can be generated for a completion,
// including visible output tokens and reasoning tokens https://platform.openai.com/docs/guides/reasoning
MaxCompletionsTokens int `json:"max_completions_tokens,omitempty"`
MaxCompletionsTokens int `json:"max_completion_tokens,omitempty"`
Temperature float32 `json:"temperature,omitempty"`
TopP float32 `json:"top_p,omitempty"`
N int `json:"n,omitempty"`
Expand Down

0 comments on commit 7f80303

Please sign in to comment.