Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
39037d25
Unverified
Commit
39037d25
authored
Jan 29, 2026
by
wangln19
Committed by
GitHub
Jan 29, 2026
Browse files
Fix tool call indexing double-counting (#33141)
Signed-off-by:
wanglinian
<
wanglinian@stu.pku.edu.cn
>
parent
51550179
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
vllm/entrypoints/openai/chat_completion/serving.py
vllm/entrypoints/openai/chat_completion/serving.py
+4
-3
No files found.
vllm/entrypoints/openai/chat_completion/serving.py
View file @
39037d25
...
@@ -982,6 +982,7 @@ class OpenAIServingChat(OpenAIServing):
...
@@ -982,6 +982,7 @@ class OpenAIServingChat(OpenAIServing):
index
=
i
,
index
=
i
,
)
)
function_name_returned
[
i
]
=
True
function_name_returned
[
i
]
=
True
history_tool_call_cnt
+=
1
delta_message
=
DeltaMessage
(
delta_message
=
DeltaMessage
(
tool_calls
=
[
tool_calls
=
[
...
@@ -1582,7 +1583,7 @@ class OpenAIServingChat(OpenAIServing):
...
@@ -1582,7 +1583,7 @@ class OpenAIServingChat(OpenAIServing):
generated_id
=
make_tool_call_id
(
generated_id
=
make_tool_call_id
(
id_type
=
self
.
tool_call_id_type
,
id_type
=
self
.
tool_call_id_type
,
func_name
=
tc
.
name
,
func_name
=
tc
.
name
,
idx
=
history_tool_call_cnt
+
idx
,
idx
=
history_tool_call_cnt
,
)
)
tool_call_class_items
.
append
(
tool_call_class_items
.
append
(
tool_call_class
(
id
=
generated_id
,
function
=
tc
)
tool_call_class
(
id
=
generated_id
,
function
=
tc
)
...
@@ -1617,7 +1618,7 @@ class OpenAIServingChat(OpenAIServing):
...
@@ -1617,7 +1618,7 @@ class OpenAIServingChat(OpenAIServing):
generated_id
=
make_tool_call_id
(
generated_id
=
make_tool_call_id
(
id_type
=
self
.
tool_call_id_type
,
id_type
=
self
.
tool_call_id_type
,
func_name
=
tool_call
.
name
,
func_name
=
tool_call
.
name
,
idx
=
history_tool_call_cnt
+
idx
,
idx
=
history_tool_call_cnt
,
)
)
tool_call_class_items
.
append
(
tool_call_class_items
.
append
(
tool_call_class
(
id
=
generated_id
,
function
=
tool_call
)
tool_call_class
(
id
=
generated_id
,
function
=
tool_call
)
...
@@ -1665,7 +1666,7 @@ class OpenAIServingChat(OpenAIServing):
...
@@ -1665,7 +1666,7 @@ class OpenAIServingChat(OpenAIServing):
generated_id
=
make_tool_call_id
(
generated_id
=
make_tool_call_id
(
id_type
=
self
.
tool_call_id_type
,
id_type
=
self
.
tool_call_id_type
,
func_name
=
tc
.
name
,
func_name
=
tc
.
name
,
idx
=
history_tool_call_cnt
+
idx
,
idx
=
history_tool_call_cnt
,
)
)
tool_call_items
.
append
(
tool_call_items
.
append
(
tool_call_class
(
id
=
generated_id
,
function
=
tc
)
tool_call_class
(
id
=
generated_id
,
function
=
tc
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment