[Misc] Add type assertion of request_id for LLMEngine.add_request (#19700)

Signed-off-by: n2ptr <xuzhanchaomail@163.com>
This commit is contained in:
Chales Xu
2025-06-28 13:47:36 +08:00
committed by GitHub
parent c329ceca6d
commit e53be6f00a
3 changed files with 14 additions and 5 deletions

View File

@@ -192,6 +192,11 @@ class LLMEngine:
prompt_adapter_request: Optional[PromptAdapterRequest] = None,
priority: int = 0,
) -> None:
# Validate the request_id type.
if not isinstance(request_id, str):
raise TypeError(
f"request_id must be a string, got {type(request_id)}")
# Process raw inputs into the request.
prompt_str, request = self.processor.process_inputs(
request_id, prompt, params, arrival_time, lora_request,