main
py 31 lines 999 Bytes
Raw
1 # SPDX-License-Identifier: Apache-2.0
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 """seed_oss parser for tool calls and reasoning.
4
5 seed_oss shares the Qwen3 XML grammar exactly; only the wrapper token
6 strings and the turn-boundary tokens differ::
7
8 <think> -> <seed:think>
9 </think> -> </seed:think>
10 <tool_call> -> <seed:tool_call>
11 </tool_call> -> </seed:tool_call>
12 <|im_start|> -> <seed:bos>
13 <|im_end|> -> <seed:eos>
14
15 ``<function=...>`` and ``<parameter=...>`` are byte-identical, so the
16 entire transition table and ``_qwen3_arg_converter`` are inherited from
17 :class:`Qwen3Parser` unchanged.
18 """
19
20 from __future__ import annotations
21
22 from vllm.parser.qwen3 import Qwen3Parser
23
24
25 class SeedOssParser(Qwen3Parser):
26 CONFIG_NAME = "seed_oss"
27 THINK_START = "<seed:think>"
28 THINK_END = "</seed:think>"
29 TOOL_START = "<seed:tool_call>"
30 TOOL_END = "</seed:tool_call>"
31 TURN_BOUNDARIES = frozenset(("<seed:bos>", "<seed:eos>"))