fix(api): preserve nullable stream compatibility
This commit is contained in:
1 parent
12c2c95cbb
commit
b6b7caafd3
2 files changed
+27
-5
No files matched your search
@@ -316,9 +316,9 @@ async def handle_chat_completions(request: web.Request) -> web.Response | web.St
|
||||
return _error_json(400, "Invalid JSON body")
|
||||
body = cast(dict[str, Any], body)
|
||||
stream_value = body.get("stream", False)
|
||||
if not isinstance(stream_value, bool):
|
||||
if stream_value is not None and not isinstance(stream_value, bool):
|
||||
return _error_json(400, "stream must be a boolean")
|
||||
stream = stream_value
|
||||
stream = stream_value is True
|
||||
requested_model = body.get("model")
|
||||
text, media_paths = _parse_json_content(body)
|
||||
session_id = body.get("session_id")
|
||||
|
||||
Reference in new issue
Block a user