[Frontend] Support custom request_id from request (#9550)

Co-authored-by: Yuhong Guo <yuhong.gyh@antgroup.com>
This commit is contained in:
Yuhong Guo
2024-10-23 02:07:30 +08:00
committed by GitHub
parent 32a1ee74a0
commit 434984e665
2 changed files with 8 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ from vllm.sequence import Logprob
from vllm.tracing import (contains_trace_headers, extract_trace_headers,
log_tracing_disabled_warning)
from vllm.transformers_utils.tokenizer import AnyTokenizer, MistralTokenizer
from vllm.utils import iterate_with_cancellation, random_uuid
from vllm.utils import iterate_with_cancellation
logger = init_logger(__name__)
@@ -176,7 +176,7 @@ class OpenAIServingChat(OpenAIServing):
"\"auto\" tool choice requires "
"--enable-auto-tool-choice and --tool-call-parser to be set")
request_id = f"chat-{random_uuid()}"
request_id = f"chat-{request.request_id}"
request_metadata = RequestResponseMetadata(request_id=request_id)
if raw_request: