OpenAI Agents SDK v0.15.0
### Better model refusal handling In this version, model refusals are now surfaced explicitly as `ModelRefusalError` instead of being treated as empty text output or, for structured outputs, causing the run loop to retry until `MaxTurnsExceeded`
OpenAI Agents SDK v0.15.0
Key Changes
Better model refusal handling
In this version, model refusals are now surfaced explicitly as ModelRefusalError instead of being treated as empty text output or, for structured outputs, causing the run loop to retry until MaxTurnsExceeded.
This affects code that previously expected a refusal-only model response to complete with final_output == "". To handle refusals without raising, provide a model_refusal run error handler:
result = Runner.run_sync(
agent,
input,
error_handlers={"model_refusal": lambda data: data.error.refusal},
)
For structured-output agents, the handler can return a value matching the agent's output schema, and the SDK will validate it like other run error handler final outputs.
What's Changed
- fix: #3055 surface model refusals during run resolution by @seratch in https://github.com/openai/openai-agents-python/pull/3057
Documentation & Other Changes
- docs: add missing space after period in MCPServerStdio docstring by @GopalGB in https://github.com/openai/openai-agents-python/pull/3053
- chore(deps): bump actions/github-script from 8.0.0 to 9.0.0 by @dependabot[bot] in https://github.com/openai/openai-agents-python/pull/3059
- chore(deps): bump peter-evans/create-pull-request from 8.1.0 to 8.1.1 by @dependabot[bot] in https://github.com/openai/openai-agents-python/pull/3062
- chore(deps): bump pypa/gh-action-pypi-publish from 1.13.0 to 1.14.0 by @dependabot[bot] in https://github.com/openai/openai-agents-python/pull/3061
- chore(deps): bump openai/codex-action from 1.6 to 1.8 by @dependabot[bot] in https://github.com/openai/openai-agents-python/pull/3060
- Release 0.15.0 by @github-actions[bot] in https://github.com/openai/openai-agents-python/pull/3063
New Contributors
- @GopalGB made their first contribution in https://github.com/openai/openai-agents-python/pull/3053
Full Changelog: https://github.com/openai/openai-agents-python/compare/v0.14.8...v0.15.0
Fuente original
Leer artículo original