Unverified Commit ae335842 authored by Chang Su's avatar Chang Su Committed by GitHub
Browse files

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

parent 477a101c
...@@ -1618,14 +1618,14 @@ async def v1_chat_completions( ...@@ -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(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment