File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
vllm/entrypoints/openai/tool_parsers Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import regex as re
8
8
9
+ from vllm .entrypoints .chat_utils import random_tool_call_id
9
10
from vllm .entrypoints .openai .protocol import (ChatCompletionRequest ,
10
11
DeltaFunctionCall , DeltaMessage ,
11
12
DeltaToolCall ,
15
16
ToolParser , ToolParserManager )
16
17
from vllm .logger import init_logger
17
18
from vllm .transformers_utils .tokenizer import AnyTokenizer
18
- from vllm .utils import random_uuid
19
19
20
20
logger = init_logger (__name__ )
21
21
@@ -267,7 +267,7 @@ def extract_tool_calls_streaming(
267
267
DeltaToolCall (
268
268
index = self .current_tool_id ,
269
269
type = "function" ,
270
- id = f"chatcmpl-tool- { random_uuid () } " ,
270
+ id = random_tool_call_id () ,
271
271
function = DeltaFunctionCall (
272
272
name = function_name ).model_dump (
273
273
exclude_none = True ),
Original file line number Diff line number Diff line change 7
7
8
8
import regex as re
9
9
10
+ from vllm .entrypoints .chat_utils import random_tool_call_id
10
11
from vllm .entrypoints .openai .protocol import (ChatCompletionRequest ,
11
12
DeltaFunctionCall , DeltaMessage ,
12
13
DeltaToolCall ,
@@ -225,7 +226,7 @@ def extract_tool_calls_streaming(
225
226
function_name = name_match .group (1 )
226
227
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 ()
229
230
delta = DeltaMessage (tool_calls = [
230
231
DeltaToolCall (
231
232
index = 0 ,
You can’t perform that action at this time.
0 commit comments