fix: add thinking parameter to match claude-code request format

This commit is contained in:
ashisgreat22 2026-04-15 08:30:09 +00:00
parent 35878c0a92
commit 5989e9a390
2 changed files with 20 additions and 10 deletions

View file

@ -14,6 +14,10 @@ func ConvertOpenAIRequest(req *ChatCompletionRequest) *AnthropicRequest {
Messages: convertMessages(remainingMessages),
System: system,
MaxTokens: 32000,
Thinking: &AnthropicThinking{
Type: "enabled",
BudgetTokens: 10000,
},
}
if req.MaxTokens != nil {

View file

@ -104,6 +104,12 @@ type AnthropicRequest struct {
StopSequences []string `json:"stop_sequences,omitempty"`
Tools []AnthropicTool `json:"tools,omitempty"`
ToolChoice *AnthropicToolChoice `json:"tool_choice,omitempty"`
Thinking *AnthropicThinking `json:"thinking,omitempty"`
}
type AnthropicThinking struct {
Type string `json:"type"`
BudgetTokens int `json:"budget_tokens,omitempty"`
}
type AnthropicMessage struct {