mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2397] [CLOSED] serve: allow JSON response_format with tools on /v1/chat/completions #4027
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4027
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2397
Author: @Xantier
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:chat-structured-tools📝 Commits (1)
1317ae3serve: allow JSON response_format with tools on /v1/chat/completions📊 Changes
3 files changed (+54 additions, -7 deletions)
View changed files
📝
docs/DETAILS.md(+5 -2)📝
serve/server.py(+16 -4)📝
serve/test_structured.py(+33 -1)📄 Description
Issue: none. Follows #782, and picks up the structured-output part of #763, which closed when main was force-pushed.
Summary
POST /v1/chat/completions returned 400 structured response_format with tools/MCP is not supported for any request that sent both tools and a JSON response_format. #782 made /v1/responses accept this combination. This PR applies the same approach to the chat route: a turn that calls a tool passes through unchanged, and the turn that ends in text is validated against the schema as before.
Measured with tool-eval-bench 2.8.1.dev1 (69 scenarios, seed 42, 3 trials each) on an RX 9070 16 GB, Ryzen 5 3600 and 64GB of DDR4-2400, running Qwen3.8-Flash-Next IQ3_S on engine 0.1.43.1 with reasoning_effort: low:
What changed
Left alone: requests without response_format, and JSON formats without tools, take the same path as before, and the existing tests pass unchanged. MCP with a JSON format is still refused, because run_with_mcp runs tool rounds inside one request, so there is no single final turn to validate.
Extra Notes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.