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
0102bd2f
Unverified
Commit
0102bd2f
authored
Apr 07, 2026
by
Flora Feng
Committed by
GitHub
Apr 08, 2026
Browse files
[Parser] Pass request.tools to tool parser (#38860)
Signed-off-by:
sfeng33
<
4florafeng@gmail.com
>
parent
83d09d36
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
vllm/entrypoints/openai/responses/serving.py
vllm/entrypoints/openai/responses/serving.py
+1
-1
vllm/parser/abstract_parser.py
vllm/parser/abstract_parser.py
+3
-2
No files found.
vllm/entrypoints/openai/responses/serving.py
View file @
0102bd2f
...
@@ -1001,7 +1001,7 @@ class OpenAIServingResponses(OpenAIServing):
...
@@ -1001,7 +1001,7 @@ class OpenAIServingResponses(OpenAIServing):
# Use parser to extract and create response output items
# Use parser to extract and create response output items
if
self
.
parser
:
if
self
.
parser
:
parser
=
self
.
parser
(
tokenizer
)
parser
=
self
.
parser
(
tokenizer
,
request
.
tools
)
return
parser
.
extract_response_outputs
(
return
parser
.
extract_response_outputs
(
model_output
=
final_output
.
text
,
model_output
=
final_output
.
text
,
model_output_token_ids
=
final_output
.
token_ids
,
model_output_token_ids
=
final_output
.
token_ids
,
...
...
vllm/parser/abstract_parser.py
View file @
0102bd2f
...
@@ -37,6 +37,7 @@ from vllm.logger import init_logger
...
@@ -37,6 +37,7 @@ from vllm.logger import init_logger
from
vllm.reasoning.abs_reasoning_parsers
import
ReasoningParser
from
vllm.reasoning.abs_reasoning_parsers
import
ReasoningParser
from
vllm.tokenizers
import
TokenizerLike
from
vllm.tokenizers
import
TokenizerLike
from
vllm.tool_parsers.abstract_tool_parser
import
ToolParser
from
vllm.tool_parsers.abstract_tool_parser
import
ToolParser
from
vllm.tool_parsers.utils
import
Tool
from
vllm.utils
import
random_uuid
from
vllm.utils
import
random_uuid
logger
=
init_logger
(
__name__
)
logger
=
init_logger
(
__name__
)
...
@@ -542,10 +543,10 @@ class _WrappedParser(DelegatingParser):
...
@@ -542,10 +543,10 @@ class _WrappedParser(DelegatingParser):
reasoning_parser_cls
:
type
[
ReasoningParser
]
|
None
=
None
reasoning_parser_cls
:
type
[
ReasoningParser
]
|
None
=
None
tool_parser_cls
:
type
[
ToolParser
]
|
None
=
None
tool_parser_cls
:
type
[
ToolParser
]
|
None
=
None
def
__init__
(
self
,
tokenizer
:
TokenizerLike
):
def
__init__
(
self
,
tokenizer
:
TokenizerLike
,
tools
:
list
[
Tool
]
|
None
=
None
):
super
().
__init__
(
tokenizer
)
super
().
__init__
(
tokenizer
)
# Instantiate the underlying parsers from class attributes
# Instantiate the underlying parsers from class attributes
if
self
.
__class__
.
reasoning_parser_cls
is
not
None
:
if
self
.
__class__
.
reasoning_parser_cls
is
not
None
:
self
.
_reasoning_parser
=
self
.
__class__
.
reasoning_parser_cls
(
tokenizer
)
self
.
_reasoning_parser
=
self
.
__class__
.
reasoning_parser_cls
(
tokenizer
)
if
self
.
__class__
.
tool_parser_cls
is
not
None
:
if
self
.
__class__
.
tool_parser_cls
is
not
None
:
self
.
_tool_parser
=
self
.
__class__
.
tool_parser_cls
(
tokenizer
)
self
.
_tool_parser
=
self
.
__class__
.
tool_parser_cls
(
tokenizer
,
tools
)
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