[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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user