Skip to content

Commit 6a9f4ab

Browse files
committed
fix: ensure arguments are replaced with '{}' if empty
1 parent 4bd39c3 commit 6a9f4ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apps/application/flow/tools.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ async def _yield_mcp_response(chat_model, message_list, mcp_servers, mcp_output_
359359

360360
entry['arguments'] += part_args
361361

362+
# 若 arguments 为空字符串,替换为 '{}'
363+
if entry['arguments'] == '':
364+
entry['arguments'] = '{}'
365+
362366
# 尝试判断 JSON 是否完整(若 arguments 是 JSON),完整则提交到 tool_calls_info
363367
try:
364368
json.loads(entry['arguments'])

0 commit comments

Comments
 (0)