Unverified Commit 10d34f74 authored by gongwei-130's avatar gongwei-130 Committed by GitHub
Browse files

fix: should return a invalid request response when schema missing (#9461)

parent 9ba72530
......@@ -81,6 +81,11 @@ class OpenAIServingChat(OpenAIServingBase):
f"This model supports at most {server_context_length} completion tokens."
)
if request.response_format and request.response_format.type == "json_schema":
schema = getattr(request.response_format.json_schema, "schema_", None)
if schema is None:
return "schema_ is required for json_schema response format request."
return None
def _convert_to_internal_request(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment