fix(api): return 400 for invalid multimodal field types

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
FanouZeng-TTandClaude Code authored and Xubin Ren committed 2026-10-03 21:08:47 +08:00
1 parent 8052c3a460
commit 96ad7b4dbf
2 files changed
+45 -1

No files matched your search

+1 -1
View File
@@ -297,7 +297,7 @@ async def handle_chat_completions(request: web.Request) -> web.Response | web.St
requested_model = body.get("model")
text, media_paths = _parse_json_content(body)
session_id = body.get("session_id")
except ValueError as e:
except (TypeError, ValueError) as e:
return _error_json(400, str(e))
except _FileSizeExceeded as e:
return _error_json(413, str(e), err_type="invalid_request_error")