Unverified Commit 39037d25 authored by wangln19's avatar wangln19 Committed by GitHub
Browse files

Fix tool call indexing double-counting (#33141)


Signed-off-by: default avatarwanglinian <wanglinian@stu.pku.edu.cn>
parent 51550179
......@@ -982,6 +982,7 @@ class OpenAIServingChat(OpenAIServing):
index=i,
)
function_name_returned[i] = True
history_tool_call_cnt += 1
delta_message = DeltaMessage(
tool_calls=[
......@@ -1582,7 +1583,7 @@ class OpenAIServingChat(OpenAIServing):
generated_id = make_tool_call_id(
id_type=self.tool_call_id_type,
func_name=tc.name,
idx=history_tool_call_cnt + idx,
idx=history_tool_call_cnt,
)
tool_call_class_items.append(
tool_call_class(id=generated_id, function=tc)
......@@ -1617,7 +1618,7 @@ class OpenAIServingChat(OpenAIServing):
generated_id = make_tool_call_id(
id_type=self.tool_call_id_type,
func_name=tool_call.name,
idx=history_tool_call_cnt + idx,
idx=history_tool_call_cnt,
)
tool_call_class_items.append(
tool_call_class(id=generated_id, function=tool_call)
......@@ -1665,7 +1666,7 @@ class OpenAIServingChat(OpenAIServing):
generated_id = make_tool_call_id(
id_type=self.tool_call_id_type,
func_name=tc.name,
idx=history_tool_call_cnt + idx,
idx=history_tool_call_cnt,
)
tool_call_items.append(
tool_call_class(id=generated_id, function=tc)
......
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