fix: preserve native model parameters and align official Claude reasoning

This commit is contained in:
Agent Workbench Dev
2026-11-06 23:07:49 +08:00
parent 8ae492301b
commit 68603f9c76
10 changed files with 508 additions and 46 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ function wireBody(config, messages, tools) {
});
if (protocol === 'anthropic-messages') return messagesBody(config, messages, tools, native);
if (protocol === 'chat-completions') return { model: config.model, messages: cleanMessages, tools, tool_choice: 'auto', ...(!isPassthrough(config) ? { [native.outputTokenField]: config.maxOutputTokens } : {}), stream, ...native.nativeParameters,
...(stream ? { stream_options: { include_usage: true } } : {}) };
...(stream && !Object.hasOwn(native.nativeParameters, 'stream_options') ? { stream_options: { include_usage: true } } : {}) };
const input = messages.flatMap(message => {
if (message.role === 'tool') return [{ type: 'function_call_output', call_id: message.tool_call_id, output: message.content }];
if (message.role === 'assistant') {