vllm.tool_parsers.streaming ¶
_bracket_level ¶
Calculate the current level of nested brackets in a string.
Source code in vllm/tool_parsers/streaming.py
extract_named_tool_call_streaming ¶
extract_named_tool_call_streaming(
*,
delta_text: str,
function_name: str,
function_name_returned: bool,
tool_call_idx: int | None,
tool_call_id_type: str,
tokenizer: TokenizerLike,
tool_call_array_index: int,
) -> tuple[DeltaMessage, bool, bool]
Build a streaming tool-call delta for forced named tool choice.
Source code in vllm/tool_parsers/streaming.py
filter_delta_text ¶
Trim trailing tool-list delimiters from required-tool streaming text.