Skip to content

Commit 43813e6

Browse files
authored
[Misc] call the pre-defined func (vllm-project#20518)
Signed-off-by: reidliu41 <reid201711@gmail.com>
1 parent cede942 commit 43813e6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

vllm/entrypoints/openai/tool_parsers/deepseekv3_tool_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import regex as re
88

9+
from vllm.entrypoints.chat_utils import random_tool_call_id
910
from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,
1011
DeltaFunctionCall, DeltaMessage,
1112
DeltaToolCall,
@@ -15,7 +16,6 @@
1516
ToolParser, ToolParserManager)
1617
from vllm.logger import init_logger
1718
from vllm.transformers_utils.tokenizer import AnyTokenizer
18-
from vllm.utils import random_uuid
1919

2020
logger = init_logger(__name__)
2121

@@ -267,7 +267,7 @@ def extract_tool_calls_streaming(
267267
DeltaToolCall(
268268
index=self.current_tool_id,
269269
type="function",
270-
id=f"chatcmpl-tool-{random_uuid()}",
270+
id=random_tool_call_id(),
271271
function=DeltaFunctionCall(
272272
name=function_name).model_dump(
273273
exclude_none=True),

vllm/entrypoints/openai/tool_parsers/xlam_tool_parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import regex as re
99

10+
from vllm.entrypoints.chat_utils import random_tool_call_id
1011
from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,
1112
DeltaFunctionCall, DeltaMessage,
1213
DeltaToolCall,
@@ -225,7 +226,7 @@ def extract_tool_calls_streaming(
225226
function_name = name_match.group(1)
226227

227228
# 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()
229230
delta = DeltaMessage(tool_calls=[
230231
DeltaToolCall(
231232
index=0,

0 commit comments

Comments
 (0)