feats: repair the thinking of claude to openrouter convert

This commit is contained in:
Nekohy
2026-03-05 06:12:48 +08:00
parent 887a929d65
commit 5b264f3a57
4 changed files with 37 additions and 7 deletions

View File

@@ -298,6 +298,7 @@ func (a *Adaptor) ConvertOpenAIRequest(c *gin.Context, info *relaycommon.RelayIn
}
reasoning := openrouter.RequestReasoning{
Enabled: true,
MaxTokens: *thinking.BudgetTokens,
}

View File

@@ -3,6 +3,7 @@ package openrouter
import "encoding/json"
type RequestReasoning struct {
Enabled bool `json:"enabled"`
// One of the following (not both):
Effort string `json:"effort,omitempty"` // Can be "high", "medium", or "low" (OpenAI-style)
MaxTokens int `json:"max_tokens,omitempty"` // Specific token limit (Anthropic-style)