Skip to content

OAI Responses API json schema support, Cohere2 MoE template parser json schema support, improvements to responses streaming compatibility - #26013

Draft
boondocklabs wants to merge 11 commits into
ggml-org:masterfrom
boondocklabs:responses-api-format
Draft

OAI Responses API json schema support, Cohere2 MoE template parser json schema support, improvements to responses streaming compatibility #26013
boondocklabs wants to merge 11 commits into
ggml-org:masterfrom
boondocklabs:responses-api-format

Conversation

@boondocklabs

Copy link
Copy Markdown
Contributor

Overview

Improves OpenAI Responses API compatibility and adds constrained schema support in Responses API, and the Cohere2 MoE chat template parser.

Additional information

  • Convert Responses API text.format settings into the corresponding Chat Completions response_format
  • Enable JSON-schema-constrained output for Cohere2 MoE
  • Improve Responses API streaming event compatibility:
    • Adds monotonically increasing sequence_number values.
    • Adds output_index and content_index where required.
    • Emits complete response snapshots for creation and completion events.
    • Emits the reasoning content-part lifecycle, including reasoning_text.done, content_part.done, and output_item.done.
    • Ensures reasoning is finalized before text or tool-call output begins.
    • Avoids emitting duplicate reasoning completion events during finalization.
    • Includes consistent response metadata and usage information in the completed event.

Testing

  • Added coverage for:
    • Conversion of Responses API text.format.type = "json_schema" into response_format.
    • Preservation of the schema name, strict mode, and schema body.
    • Cohere2 MoE parsing of a schema-constrained JSON response with reasoning and tools enabled.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: Yes, ChatGPT used for code exploration and analyzing logic, all code edits and validation performed manually.

cohere2 moe template parser: enforce JSON schema for text responses if a response schema is provided
responses api streaming: emit reasoning done events before text or tool calls. add response.content_part.* events to reasoning. add response.reasoning_text.done event.
@boondocklabs
boondocklabs requested review from a team and pwilkin as code owners July 22, 2026 19:45
@github-actions github-actions Bot added testing Everything test related server labels Jul 22, 2026
@pwilkin

pwilkin commented Jul 22, 2026

Copy link
Copy Markdown
Member

This looks fine, but please split this into two separate PRs. The Cohere chat parser fixes and the OAI response fixes are completely unrelated.

@boondocklabs
boondocklabs marked this pull request as draft July 22, 2026 21:48
@boondocklabs

Copy link
Copy Markdown
Contributor Author

This looks fine, but please split this into two separate PRs. The Cohere chat parser fixes and the OAI response fixes are completely unrelated.

Converted this PR to a draft and submitted #26018 for the Cohere parser. I can only open a single PR at a time, so I'll submit the other when it's merged.

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

Labels

server testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants