[bugfix] Fix online serving crash when text type response_format is received (#26822)

Signed-off-by: cjackal <44624812+cjackal@users.noreply.github.com>
Signed-off-by: j0shuajun <59368606+j0shuajun@users.noreply.github.com>
Co-authored-by: j0shuajun <59368606+j0shuajun@users.noreply.github.com>
This commit is contained in:
cjackal
2026-01-16 12:23:54 +08:00
committed by GitHub
co-authored by j0shuajun
parent 5de6dd0662
commit 35bf5d08e8
6 changed files with 68 additions and 26 deletions
+3 -2
View File
@@ -65,10 +65,11 @@ class ToolParser:
# Set structured output params for tool calling
if json_schema_from_tool is not None:
if isinstance(request, ChatCompletionRequest):
request.structured_outputs = StructuredOutputsParams()
# tool_choice: "Forced Function" or "required" will override
# structured output json settings to make tool calling work correctly
request.structured_outputs.json = json_schema_from_tool
request.structured_outputs = StructuredOutputsParams(
json=json_schema_from_tool
)
request.response_format = None
if isinstance(request, ResponsesRequest):
request.text = ResponseTextConfig()