Repository navigation
feat: add Responses API and reasoning replay - #1151
andreatnvidia wants to merge 1 commit into
Conversation
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
[Medium impact] The PR extends selectable model API routing across generation and conversation workflows. The PR appears safe to merge, with a non-blocking CLI issue when changing a Responses-backed model to embeddings. Findings
Fix with agent prompt### Issue 1
packages/data-designer/src/data_designer/cli/forms/model_builder.py:279-280
When a user edits a Responses-backed model and selects Embedding, `run()` keeps `api="responses"` from the old configuration. `ModelConfig` rejects that combination, so the edit cannot be saved. The form has no API field to change it, leaving users to edit the saved configuration manually. Reset `api` to `"chat-completions"` when the selected generation type is not chat completion.
```suggestion
if initial_data:
full_data["api"] = (
initial_data.get("api", "chat-completions")
if generation_type == GenerationType.CHAT_COMPLETION
else "chat-completions"
)
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds opt-in Responses API support for generation and MCP calls.
Acknowledgment:
|
| if initial_data: | ||
| full_data["api"] = initial_data.get("api", "chat-completions") |
There was a problem hiding this comment.
When a user edits a Responses-backed model and selects Embedding, run() keeps api="responses" from the old configuration. ModelConfig rejects that combination, so the edit cannot be saved. The form has no API field to change it, leaving users to edit the saved configuration manually. Reset api to "chat-completions" when the selected generation type is not chat completion.
| if initial_data: | |
| full_data["api"] = initial_data.get("api", "chat-completions") | |
| if initial_data: | |
| full_data["api"] = ( | |
| initial_data.get("api", "chat-completions") | |
| if generation_type == GenerationType.CHAT_COMPLETION | |
| else "chat-completions" | |
| ) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/data-designer/src/data_designer/cli/forms/model_builder.py
Line: 279-280
Comment:
**Switching to embeddings fails**
When a user edits a Responses-backed model and selects Embedding, `run()` keeps `api="responses"` from the old configuration. `ModelConfig` rejects that combination, so the edit cannot be saved. The form has no API field to change it, leaving users to edit the saved configuration manually. Reset `api` to `"chat-completions"` when the selected generation type is not chat completion.
```suggestion
if initial_data:
full_data["api"] = (
initial_data.get("api", "chat-completions")
if generation_type == GenerationType.CHAT_COMPLETION
else "chat-completions"
)
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
Fern preview: https://nvidia-preview-pr-1151.docs.buildwithfern.com/nemo/datadesigner
|
|
One decision to settle before changing the defaults: I propose having This is configured routing, not retry-based fallback. It preserves existing call sites when defaults change and makes the migration visible. Although the naming becomes less endpoint-specific, This slightly adjusts @nabinchha's proposal: completion behavior remains unchanged for existing configurations, while Responses-backed defaults work through existing methods. We would still need to validate parameter compatibility for replacement models. |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
I found one Warning: changing a Responses-backed model to an embedding model in the CLI always fails validation because the hidden API selection is retained.
I inspected all 14 changed files and traced the affected configuration, adapter, facade, generation, and MCP paths. This was a static review; I didn't execute tests or independently verify the reported live-provider checks.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| # Merge results | ||
| full_data = {**basic_result, "inference_parameters": inference_params} | ||
| if initial_data: | ||
| full_data["api"] = initial_data.get("api", "chat-completions") |
There was a problem hiding this comment.
Warning: Reset the API when changing to embedding generation
Failure: Edit an existing ModelConfig(api="responses"), select Embedding, and submit the inference form. This branch unconditionally retains api="responses", but the new model validator rejects that combination. The form has no API field, so retrying cannot produce a valid embedding configuration. The supported generation-type change should save successfully.
Correction: In ModelFormBuilder.run, preserve the initial API only for chat generation. Replace the new conditional with:
if initial_data and generation_type == GenerationType.CHAT_COMPLETION:
full_data["api"] = initial_data.get("api", "chat-completions")The embedding branch then uses build_config()'s default API. Keep the validator unchanged: direct construction of an embedding model with api="responses" must remain invalid.
Preservation and acceptance: Add a proposed regression test with an initial Responses model and mocked form answers selecting GenerationType.EMBEDDING, followed by {}. Assert that run() returns an embedding configuration with api == "chat-completions" without entering the retry prompt. Retain both assertions in test_edit_model_preserves_api: ordinary chat edits must preserve either API. Also check that a newly created embedding model still uses the default API. This patch is source-reasoned, not executed; verify it before adopting it.
Summary
Add opt-in Responses API support so DD can preserve OpenAI reasoning across follow-up calls and run normal column generation and MCP tool loops with Responses-backed models. This provides the API path needed for newer OpenAI reasoning/tool workflows and removes a blocker to choosing newer defaults as the existing models are retired.
The facade follows Nabin's proposed approach: explicit
responses()/aresponses(), the existingModelProviderconfiguration and completion defaults, and caller-owned conversation history. DD handles provider translation, retries, request admission, and usage accounting; Anthropic continues to use its native Messages API and replayable thinking blocks.Related Issue
/v1/responses) and Vertex AI: model access for a multi-turn benchmark #1033. Vertex AI transport and credential refresh remain separate work, so this PR does not close the whole issue.gpt-5is retired on 2026-12-11 #1129: enables Responses-backed candidates for newer OpenAI defaults, including reasoning-enabled tool workflows discussed in the issue thread. This PR does not change the default model IDs.Changes
ModelConfig.api="responses"to routegenerate()/agenerate(), column generation, and MCP calls through Responses using the existing OpenAI provider.store=falseand encrypted reasoning inclusion; preserve output items and tool-call IDs across rounds.Testing
.venv/bin/pytest: 5,269 passed, 11 skipped.Checklist