[CI] Return HTTP 400 for unsupported chat content part type (#41121)
Signed-off-by: haosdent <haosdent@gmail.com>
This commit is contained in:
@@ -40,6 +40,7 @@ from typing_extensions import Required, TypedDict
|
||||
|
||||
from vllm import envs
|
||||
from vllm.config import ModelConfig
|
||||
from vllm.exceptions import VLLMValidationError
|
||||
from vllm.inputs import MultiModalDataDict, MultiModalUUIDDict
|
||||
from vllm.logger import init_logger
|
||||
from vllm.model_executor.models import SupportsMultiModal
|
||||
@@ -1501,7 +1502,13 @@ def _parse_chat_message_content_part(
|
||||
mm_parser.parse_video(str_content, uuid)
|
||||
modality = "video"
|
||||
else:
|
||||
raise NotImplementedError(f"Unknown part type: {part_type}")
|
||||
supported = sorted(MM_PARSER_MAP.keys() | set(PART_TYPES_TO_SKIP_NONE_CONTENT))
|
||||
raise VLLMValidationError(
|
||||
f"Unsupported chat content part type: {part_type!r}. "
|
||||
f"Supported types: {', '.join(supported)}.",
|
||||
parameter="type",
|
||||
value=part_type,
|
||||
)
|
||||
|
||||
if wrap_dicts:
|
||||
return {"type": modality}
|
||||
|
||||
Reference in New Issue
Block a user