openrouter 思考模式+流式下不兼容 openai TS SDK 的 finalChatCompletion函数

佬们帮我看看对不对 openrouter的思维链返回在reasoning_details非标准字段中。如果此时使用 const stream= client.chat.completions.stream(...) await stream.finalChatCompletion() 在ChatCo...
openrouter 思考模式+流式下不兼容 openai TS SDK 的 finalChatCompletion函数
openrouter 思考模式+流式下不兼容 openai TS SDK 的 finalChatCompletion函数

佬们帮我看看对不对
openrouter的思维链返回在reasoning_details非标准字段中。如果此时使用

const stream= client.chat.completions.stream(...)
await stream.finalChatCompletion()

在ChatCompletionStream.ts中的accumulateChatCompletion函数
非标准字段会直接赋值而不是拼接
Object.assign(choice.message, rest);
因此 reasoning_details 就只会剩下最后一个…

1 个帖子 - 1 位参与者

阅读完整话题

来源: LinuxDo 最新话题查看原文