fix: Reasoning tag for OpenRouter is reasoning

This commit is contained in:
hycqwq 2025-05-03 20:53:42 +08:00
parent 2a59a38c23
commit b8d9a5a604

View File

@ -161,7 +161,7 @@ export class OpenRouterApi implements LLMApi {
delta: { delta: {
content: string | null; content: string | null;
tool_calls: ChatMessageTool[]; tool_calls: ChatMessageTool[];
reasoning_content: string | null; reasoning: string | null;
}; };
}>; }>;
const tool_calls = choices[0]?.delta?.tool_calls; const tool_calls = choices[0]?.delta?.tool_calls;
@ -183,7 +183,7 @@ export class OpenRouterApi implements LLMApi {
runTools[index]["function"]["arguments"] += args; runTools[index]["function"]["arguments"] += args;
} }
} }
const reasoning = choices[0]?.delta?.reasoning_content; const reasoning = choices[0]?.delta?.reasoning;
const content = choices[0]?.delta?.content; const content = choices[0]?.delta?.content;
// Skip if both content and reasoning_content are empty or null // Skip if both content and reasoning_content are empty or null