Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com> Co-authored-by: cjackal <44624812+cjackal@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
18 lines
596 B
Python
18 lines
596 B
Python
# SPDX-License-Identifier: Apache-2.0
|
||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||
|
||
from vllm.tool_parsers.deepseekv32_tool_parser import DeepSeekV32ToolParser
|
||
|
||
|
||
class DeepSeekV4ToolParser(DeepSeekV32ToolParser):
|
||
"""
|
||
DeepSeek V4 DSML tool parser.
|
||
|
||
V4 keeps the V3.2 DSML invoke/parameter grammar, but wraps tool calls in
|
||
``<|DSML|tool_calls>`` instead of ``<|DSML|function_calls>``.
|
||
"""
|
||
|
||
tool_call_start_token: str = "<|DSML|tool_calls>"
|
||
tool_call_end_token: str = "</|DSML|tool_calls>"
|
||
structural_tag_model = "deepseek_v4"
|