fix[MCP]: enhance tool call handling in OpenAIProvider (#3642)

This commit is contained in:
LiuVaayne 2025-03-20 11:51:25 +08:00 committed by GitHub
parent 70ba8df57c
commit f6cb501119
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)
console.log('start invoke tools', toolCalls)
if (this.isZhipuTool(model)) {