[Bugfix]: Fix call for function_call_parser.multi_format_detector in adapter.py (#6650)

This commit is contained in:
Chang Su
2025-05-26 21:57:10 -07:00
committed by GitHub
parent 477a101cbd
commit ae33584235

View File

@@ -1618,14 +1618,14 @@ async def v1_chat_completions(
latest_delta_len = len(call_item.parameters) latest_delta_len = len(call_item.parameters)
expected_call = json.dumps( expected_call = json.dumps(
parser.multi_format_parser.detectors[0] parser.detector.prev_tool_call_arr[index].get(
.prev_tool_call_arr[index] "arguments", {}
.get("arguments", {}), ),
ensure_ascii=False, ensure_ascii=False,
) )
actual_call = parser.multi_format_parser.detectors[ actual_call = parser.detector.streamed_args_for_tool[
0 index
].streamed_args_for_tool[index] ]
if latest_delta_len > 0: if latest_delta_len > 0:
actual_call = actual_call[:-latest_delta_len] actual_call = actual_call[:-latest_delta_len]
remaining_call = expected_call.replace( remaining_call = expected_call.replace(