File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,9 @@ func (o *Client) buildChatCompletionParams(
69
69
70
70
if ! opts .Raw {
71
71
ret .Temperature = openai .Float (opts .Temperature )
72
- ret .TopP = openai .Float (opts .TopP )
72
+ if opts .TopP != 0 {
73
+ ret .TopP = openai .Float (opts .TopP )
74
+ }
73
75
if opts .MaxTokens != 0 {
74
76
ret .MaxTokens = openai .Int (int64 (opts .MaxTokens ))
75
77
}
Original file line number Diff line number Diff line change @@ -221,7 +221,9 @@ func (o *Client) buildResponseParams(
221
221
222
222
if ! opts .Raw {
223
223
ret .Temperature = openai .Float (opts .Temperature )
224
- ret .TopP = openai .Float (opts .TopP )
224
+ if opts .TopP != 0 {
225
+ ret .TopP = openai .Float (opts .TopP )
226
+ }
225
227
if opts .MaxTokens != 0 {
226
228
ret .MaxOutputTokens = openai .Int (int64 (opts .MaxTokens ))
227
229
}
You can’t perform that action at this time.
0 commit comments