mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
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:
@@ -141,6 +141,15 @@ export function openaiToClaudeRequest(model, body, stream) {
|
|||||||
result.tool_choice = convertOpenAIToolChoice(body.tool_choice);
|
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
|
// Attach toolNameMap to result for response translation
|
||||||
if (toolNameMap.size > 0) {
|
if (toolNameMap.size > 0) {
|
||||||
result._toolNameMap = toolNameMap;
|
result._toolNameMap = toolNameMap;
|
||||||
|
|||||||
Reference in New Issue
Block a user