A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 03:30 UTC
[Misc] call the pre-defined func (#20518)
Signed-off-by: reidliu41 <reid201711@gmail.com>
Reid committed
Jul 6, 2025 at 18:25 UTC
43813e6361f3c0fd411f12ece9eab693e29860ff
2 files changed
+4
-3
vllm/entrypoints/openai/tool_parsers/deepseekv3_tool_parser.py
+2
-2
@@ -6,6 +6,7 @@ from typing import Union
6
7
import regex as re
8
9
+from vllm.entrypoints.chat_utils import random_tool_call_id
10
from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,
11
DeltaFunctionCall, DeltaMessage,
12
DeltaToolCall,
@@ -15,7 +16,6 @@ from vllm.entrypoints.openai.tool_parsers.abstract_tool_parser import (
16
ToolParser, ToolParserManager)
17
from vllm.logger import init_logger
18
from vllm.transformers_utils.tokenizer import AnyTokenizer
18
-from vllm.utils import random_uuid
19
20
logger = init_logger(__name__)
21
@@ -267,7 +267,7 @@ class DeepSeekV3ToolParser(ToolParser):
267
DeltaToolCall(
268
index=self.current_tool_id,
269
type="function",
270
- id=f"chatcmpl-tool-{random_uuid()}",
270
+ id=random_tool_call_id(),
271
function=DeltaFunctionCall(
272
name=function_name).model_dump(
273
exclude_none=True),
vllm/entrypoints/openai/tool_parsers/xlam_tool_parser.py
+2
-1
@@ -7,6 +7,7 @@ from typing import Any, Optional, Union
7
8
import regex as re
9
10
+from vllm.entrypoints.chat_utils import random_tool_call_id
11
from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,
12
DeltaFunctionCall, DeltaMessage,
13
DeltaToolCall,
@@ -225,7 +226,7 @@ class xLAMToolParser(ToolParser):
226
function_name = name_match.group(1)
227
228
# The test expects us to send just the name first
228
- tool_id = f"chatcmpl-tool-{random_uuid()}"
229
+ tool_id = random_tool_call_id()
230
delta = DeltaMessage(tool_calls=[
231
DeltaToolCall(
232
index=0,