Skip to content

fix: parse JSON output in /v1/responses endpoint#614

Open
TipKnuckle wants to merge 1 commit intojundot:mainfrom
TipKnuckle:fix/responses-api-json-parsing
Open

fix: parse JSON output in /v1/responses endpoint#614
TipKnuckle wants to merge 1 commit intojundot:mainfrom
TipKnuckle:fix/responses-api-json-parsing

Conversation

@TipKnuckle
Copy link
Copy Markdown
Contributor

Summary

The /v1/responses endpoint was missing the parse_json_output() post-processing step that /v1/chat/completions already performs. When response_format is specified and the model wraps JSON in markdown code blocks (common when xgrammar is unavailable), the raw markdown was returned to the client instead of parsed JSON.

Changes

  • Added parse_json_output() call in create_response() (non-streaming /v1/responses) between tool call extraction and output building, matching the existing pattern in create_chat_completion().

Closes #613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/v1/responses endpoint returns raw markdown-wrapped JSON instead of parsed JSON

2 participants