Skip to content

Commit 9fe2475

Browse files
fix: 确保 functionCall 的 name 存在并正确格式化
Co-authored-by: aider (vertex_ai/gemini-2.5-pro) <aider@aider.chat>
1 parent 005c6e1 commit 9fe2475

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/mcp-server/src/gemini-client.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,15 @@ export class GeminiApiClient {
193193
if (part.text) {
194194
yield { type: 'text', data: part.text };
195195
}
196-
if (part.functionCall) {
197-
yield { type: 'tool_code', data: part.functionCall };
196+
if (part.functionCall && part.functionCall.name) {
197+
yield {
198+
type: 'tool_code',
199+
data: {
200+
name: part.functionCall.name,
201+
args:
202+
(part.functionCall.args as Record<string, unknown>) ?? {},
203+
},
204+
};
198205
}
199206
}
200207
}

0 commit comments

Comments
 (0)