mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-01 17:59:09 +08:00
fix(GeminiAPIClient, mcp-tools): enhance tool call handling and lookup logic (#8009)
* fix(GeminiAPIClient, mcp-tools): enhance tool call handling and lookup logic * fix: unuse log
This commit is contained in:
parent
f85f46c248
commit
3350c3e2e5
@ -593,6 +593,13 @@ export class GeminiAPIClient extends BaseApiClient<
|
||||
}
|
||||
} as LLMWebSearchCompleteChunk)
|
||||
}
|
||||
if (toolCalls.length > 0) {
|
||||
controller.enqueue({
|
||||
type: ChunkType.MCP_TOOL_CREATED,
|
||||
tool_calls: [...toolCalls]
|
||||
})
|
||||
toolCalls.length = 0
|
||||
}
|
||||
controller.enqueue({
|
||||
type: ChunkType.LLM_RESPONSE_COMPLETE,
|
||||
response: {
|
||||
|
||||
@ -391,7 +391,7 @@ export function geminiFunctionCallToMcpTool(
|
||||
): MCPTool | undefined {
|
||||
if (!toolCall) return undefined
|
||||
if (!mcpTools) return undefined
|
||||
const tool = mcpTools.find((tool) => tool.id === toolCall.name)
|
||||
const tool = mcpTools.find((tool) => tool.id === toolCall.name || tool.name === toolCall.name)
|
||||
if (!tool) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user