|
|
@@ -496,7 +496,7 @@ def analysis_chat():
|
|
|
tc_chunk = delta['tool_calls']
|
|
|
print(f"Chunk {chunk_count}: tool_calls received: {json.dumps(tc_chunk, ensure_ascii=False)[:200]}")
|
|
|
for tc in tc_chunk:
|
|
|
- index = tc.index
|
|
|
+ index = tc.get('index', 0)
|
|
|
if index >= len(tool_calls_buffer):
|
|
|
tool_calls_buffer.append({'id': '', 'type': 'function', 'function': {'name': '', 'arguments': ''}})
|
|
|
|