Skip to content

fix: forward config params to structured_output() in OpenAIResponsesModel#2069

Open
Zelys-DFKH wants to merge 1 commit intostrands-agents:mainfrom
Zelys-DFKH:fix/openai-responses-structured-output-params
Open

fix: forward config params to structured_output() in OpenAIResponsesModel#2069
Zelys-DFKH wants to merge 1 commit intostrands-agents:mainfrom
Zelys-DFKH:fix/openai-responses-structured-output-params

Conversation

@Zelys-DFKH
Copy link
Copy Markdown

Description

structured_output() called _format_request() but only extracted ["input"],
silently dropping all config params (max_output_tokens, reasoning,
instructions, etc.). The stream() method does not have this issue because
it passes the full request dict to responses.create().

The fix calls _format_request() once, then builds parse_kwargs from the
full result excluding "model" and "input" (handled explicitly) and "stream"
(hardcoded by _format_request(), incompatible with responses.parse()).

Related Issues

Resolves #1908

Documentation PR

N/A

Type of Change

Bug fix

Testing

How have you tested the change?

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…odel

structured_output() called _format_request() but only extracted ["input"],
silently dropping all config params (max_output_tokens, reasoning,
instructions, etc.). The stream() method does not have this issue because
it passes the full request dict to responses.create().

The fix calls _format_request() once, then builds parse_kwargs from the
full result excluding "model" and "input" (handled explicitly) and "stream"
(hardcoded by _format_request(), incompatible with responses.parse()).

Resolves strands-agents#1908
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] OpenAIResponsesModel.structured_output() drops config params (temperature, reasoning, etc.)

1 participant