You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ResponseFunctionWebSearch doesn't match returned payload #3179
Confirm this is an issue with the Python library and not an underlying OpenAI API
This is an issue with the Python library
Describe the bug
The ResponseFunctionWebSearch suggests that action can't be None but I get a response where it is (via the agents SDK, but the type is defined in this package)
In text form, the payload of interest I get looks like this:
Thanks for sharing the example—it makes the mismatch clear. The generated type promises an action, but the None value you observed makes accessing .type fail. As a workaround, check item.action is not None before accessing it; that avoids this attribute error while the contract is corrected.
We’re closing this report to keep the work together in openai/openai-openapi#572; please follow that issue for progress. It preserves your example and tracks the distinction between an omitted action and explicit JSON null, which the Python representation alone cannot establish.
Activity
anishesg commentedon Apr 30, 2026
PR up at #3181.
Xsidz commentedon Aug 16, 2026
Working on this in PR #3626.
marcuswood-oai commentedon Sep 15, 2026
Thanks for sharing the example—it makes the mismatch clear. The generated type promises an
action, but theNonevalue you observed makes accessing.typefail. As a workaround, checkitem.action is not Nonebefore accessing it; that avoids this attribute error while the contract is corrected.We’re closing this report to keep the work together in openai/openai-openapi#572; please follow that issue for progress. It preserves your example and tracks the distinction between an omitted action and explicit JSON
null, which the Python representation alone cannot establish.