[Misc] Use VLLMValidationError consistently in chat completion and completion protocol validators (#36254)

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
This commit is contained in:
Umut Polat
2026-06-01 04:04:11 +00:00
committed by GitHub
parent 8b8546da1c
commit f46e6be169
3 changed files with 100 additions and 24 deletions
@@ -447,8 +447,9 @@ class CompletionRequest(OpenAIBaseModel):
)
if prompt_is_empty and embeds_is_empty:
raise ValueError(
"Either prompt or prompt_embeds must be provided and non-empty."
raise VLLMValidationError(
"Either prompt or prompt_embeds must be provided and non-empty.",
parameter="prompt",
)
return data
@@ -459,8 +460,9 @@ class CompletionRequest(OpenAIBaseModel):
if data.get("cache_salt") is not None and (
not isinstance(data["cache_salt"], str) or not data["cache_salt"]
):
raise ValueError(
"Parameter 'cache_salt' must be a non-empty string if provided."
raise VLLMValidationError(
"Parameter 'cache_salt' must be a non-empty string if provided.",
parameter="cache_salt",
)
return data