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 66
77import regex as re
88
9+ from vllm .entrypoints .chat_utils import random_tool_call_id
910from vllm .entrypoints .openai .protocol import (ChatCompletionRequest ,
1011 DeltaFunctionCall , DeltaMessage ,
1112 DeltaToolCall ,
1516 ToolParser , ToolParserManager )
1617from vllm .logger import init_logger
1718from vllm .transformers_utils .tokenizer import AnyTokenizer
18- from vllm .utils import random_uuid
1919
2020logger = 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 ),
Original file line number Diff line number Diff line change 77
88import regex as re
99
10+ from vllm .entrypoints .chat_utils import random_tool_call_id
1011from 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 ,
You can’t perform that action at this time.
0 commit comments