Merge pull request #77 from Blade096/fix/openai_to_claude_missingthinking

feat(translator): add thinking parameter support in OpenAI → Claude
This commit is contained in:
decolua
2026-02-08 16:47:24 +07:00
committed by GitHub

View File

@@ -141,6 +141,15 @@ export function openaiToClaudeRequest(model, body, stream) {
result.tool_choice = convertOpenAIToolChoice(body.tool_choice);
}
// Thinking configuration
if (body.thinking) {
result.thinking = {
type: body.thinking.type || "enabled",
...(body.thinking.budget_tokens && { budget_tokens: body.thinking.budget_tokens }),
...(body.thinking.max_tokens && { max_tokens: body.thinking.max_tokens })
};
}
// Attach toolNameMap to result for response translation
if (toolNameMap.size > 0) {
result._toolNameMap = toolNameMap;