Skip to content

Commit 06d6c2b

Browse files
authored
Adds reasoning enabled (#20)
Adds 'enabled' in PostOpenrouterReasoningRequest Trying to fix this error ``` chat request failed: status_code: 400, url: https://openrouter.ai/api/v1/chat/completions body: {"error":{"message":"\"reasoning.max_tokens\" must be less than total tokens and greater than or equal to 1024","code":400,"metadata":{"provider_name":"Google"}} ```
1 parent 7333769 commit 06d6c2b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

chat.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ type PostOpenrouterReasoningRequest struct {
248248

249249
// Optional: Default is false. All models support this.
250250
Exclude bool `json:"exclude"` // // Set to true to exclude reasoning tokens from response
251+
252+
// Or enable reasoning with the default parameters:
253+
Enabled bool `json:"enabled"` // Default: inferred from `effort` or `max_tokens`
251254
}
252255

253256
type StreamOptions struct {

0 commit comments

Comments
 (0)