fix[MCP]: enhance tool call handling in OpenAIProvider (#3642)
This commit is contained in:
parent
70ba8df57c
commit
f6cb501119
@ -497,7 +497,7 @@ export default class OpenAIProvider extends BaseProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (finishReason === 'tool_calls') {
|
if (finishReason === 'tool_calls' || (finishReason === 'stop' && Object.keys(final_tool_calls).length > 0)) {
|
||||||
const toolCalls = Object.values(final_tool_calls).map(this.cleanToolCallArgs)
|
const toolCalls = Object.values(final_tool_calls).map(this.cleanToolCallArgs)
|
||||||
console.log('start invoke tools', toolCalls)
|
console.log('start invoke tools', toolCalls)
|
||||||
if (this.isZhipuTool(model)) {
|
if (this.isZhipuTool(model)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user