Skip to content

feat: support reasoning, text.format, and service_tier in /v1/responses API#6624

Closed
vvagias wants to merge 1 commit into
ai-dynamo:mainfrom
vvagias:vvagias/responses-api-pass-through
Closed

feat: support reasoning, text.format, and service_tier in /v1/responses API#6624
vvagias wants to merge 1 commit into
ai-dynamo:mainfrom
vvagias:vvagias/responses-api-pass-through

Conversation

@vvagias
Copy link
Copy Markdown
Contributor

@vvagias vvagias commented Feb 26, 2026

Summary

  • Remove 501 "Not Implemented" rejections for reasoning, text, and service_tier parameters in the /v1/responses endpoint
  • Map reasoning.effortreasoning_effort on the internal chat completions request
  • Map text.formatresponse_format (text / json_object / json_schema) on the internal chat completions request
  • Map service_tierservice_tier on the internal chat completions request
  • Echo all three parameters back in the response object per the OpenAI spec
  • Fix OutputMessage deserialization: make id and status fields #[serde(default)] so clients can send assistant messages in input without these fields
  • Add 11 unit tests covering all new mappings and echo-back behavior

Motivation

The /v1/responses API currently rejects several valid OpenAI parameters with HTTP 501, even though the underlying chat completions backend already supports them. This PR removes those artificial gates and wires up the translation layer.

Test plan

  • cargo test -p dynamo-llm — all new and existing tests pass
  • cargo clippy -p dynamo-llm — no warnings
  • Deployed to staging with TRT-LLM backend (Nemotron Nano 30B FP8) and verified:
    • reasoning.effort accepted and echoed back
    • text.format accepted and echoed back
    • service_tier accepted and echoed back
    • OutputMessage deserialization works for assistant messages without id/status

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for OpenAI Responses API fields: reasoning, text formatting options, and service tier configuration.
  • Improvements

    • Enhanced message handling flexibility with sensible defaults, enabling reuse of assistant messages without explicit metadata.
    • Improved API compatibility between Responses and Chat Completions endpoints.

…es API

Remove the 501 validation blocks for reasoning, text, and service_tier
in the Responses API handler. Map these fields through to the underlying
Chat Completions request (reasoning.effort -> reasoning_effort,
text.format -> response_format, service_tier with enum conversion) and
echo actual values back in the response instead of hardcoded defaults.

Fix OutputMessage deserialization by making id and status fields
default-able so that clients can send assistant messages without those
fields in multi-turn conversations.

Signed-off-by: Vasilis Vagias <vvagias@nvidia.com>
@vvagias vvagias requested a review from a team as a code owner February 26, 2026 15:42
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Feb 26, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Hi vvagias! Thank you for contributing to ai-dynamo/dynamo.

Just a reminder: The NVIDIA Test Github Validation CI runs an essential subset of the testing framework to quickly catch errors.Your PR reviewers may elect to test the changes comprehensively before approving your changes.

🚀

@github-actions github-actions Bot added feat external-contribution Pull request is from an external contributor frontend `python -m dynamo.frontend` and `dynamo-run in=http|text|grpc` and removed external-contribution Pull request is from an external contributor feat labels Feb 26, 2026
@github-actions github-actions Bot added the feat label Feb 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a35df0f and 0b7b937.

📒 Files selected for processing (3)
  • lib/async-openai/src/types/responses/response.rs
  • lib/llm/src/http/service/openai.rs
  • lib/llm/src/protocols/openai/responses/mod.rs

Walkthrough

The changes extend OpenAI API response handling by adding support for reasoning, text, and service_tier fields in the Responses API. Default behaviors are introduced for OutputStatus and OutputMessage deserialization, while conversion logic maps these new fields between the Responses and Chat Completions API formats.

Changes

Cohort / File(s) Summary
Response Type Defaults
lib/async-openai/src/types/responses/response.rs
Added Default derivation to OutputStatus with Completed as default variant. Annotated OutputMessage fields (id, status) with #[serde(default)] to improve deserialization flexibility. Added documentation explaining default field behavior.
OpenAI Service Integration
lib/llm/src/http/service/openai.rs, lib/llm/src/protocols/openai/responses/mod.rs
Added reasoning, text, and service_tier fields to ResponseParams struct and extended request/response plumbing to propagate these fields between Responses and Chat Completions API formats. Introduced conversion helpers for text format and service tier mapping. Removed validation checks blocking these fields. Added comprehensive tests for new field mappings and echo behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Defaults bloom and fields align,
Responses flow through the service line,
Reasoning, text, and tiers now play,
Conversions hop in every way! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: support reasoning, text.format, and service_tier in /v1/responses API' clearly and concisely describes the main feature addition across all three changed files.
Description check ✅ Passed The description comprehensively covers the Summary, Motivation, and Test plan sections with detailed technical changes and verification details matching the template's requirements.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vvagias
Copy link
Copy Markdown
Contributor Author

vvagias commented Feb 26, 2026

Superseded by a new PR that stacks on top of #6599 to avoid conflicts.

@vvagias vvagias closed this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat frontend `python -m dynamo.frontend` and `dynamo-run in=http|text|grpc` size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant