Skip to content

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

@Di-Is

Description

@Di-Is

Bug Description

OpenAIResponsesModel.structured_output() silently drops user-configured params like temperature, max_output_tokens, reasoning (for o-series models), etc.

Root Cause

The structured_output() method calls _format_request() which correctly spreads self.config["params"] into the request dict. However, structured_output() only extracts model and input from the result — all other params from the request are silently dropped when calling client.responses.parse().

Reproduction

from strands.models.openai_responses import OpenAIResponsesModel

model = OpenAIResponsesModel(
    model_id="o3",
    params={
        "temperature": 0.5,
        "max_output_tokens": 1000,
        "reasoning": {"effort": "high"},  # Important for o-series models
    },
)

# These params are correctly passed in model.stream() via _format_request(),
# but in structured_output(), only "model" and "input" are extracted from
# the request dict — temperature, max_output_tokens, reasoning are all dropped.

Expected Behavior

All params from the config should be passed through to client.responses.parse(), excluding keys that are already individually handled or inappropriate (model, input, stream, tools, instructions).

Actual Behavior

Only model, input, and text_format are passed to responses.parse(). All other config params are silently ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions