[Frontend] Add Streaming Parser Engine and new Qwen3 Parser (#45413)
Signed-off-by: Ben Browning <bbrownin@redhat.com> Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
co-authored by
Flora Feng
parent
e3e3cd5458
commit
c4a3f9d137
@@ -0,0 +1,26 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""Semantic event types emitted by the streaming parser engine."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum, auto
|
||||
|
||||
|
||||
class EventType(Enum):
|
||||
TEXT_CHUNK = auto()
|
||||
REASONING_START = auto()
|
||||
REASONING_CHUNK = auto()
|
||||
REASONING_END = auto()
|
||||
TOOL_CALL_START = auto()
|
||||
TOOL_NAME = auto()
|
||||
ARG_VALUE_CHUNK = auto()
|
||||
TOOL_CALL_END = auto()
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class SemanticEvent:
|
||||
type: EventType
|
||||
value: str = ""
|
||||
tool_index: int = -1
|
||||
Reference in New Issue
Block a user