Confirm this is an issue with the Python library and not an underlying OpenAI API
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:
ResponseFunctionWebSearch(
id='ws_...264',
action=None,
status='completed',
type='web_search_call'
)
There were four web searches, the first two had an action, the second two didn't.
To Reproduce
I have code like this parsing a response that did a web search:
search_count = sum(
1
for raw_response in response.raw_responses
for item in raw_response.output
if item.type == "web_search_call" and item.action.type == "search"
)
Which should have been a safe assumption based on the types, but raises an error.
Code snippets
OS
Windows 11
Python version
3.14
Library version
2.32
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
The
ResponseFunctionWebSearchsuggests thatactioncan't beNonebut 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:
There were four web searches, the first two had an action, the second two didn't.
To Reproduce
I have code like this parsing a response that did a web search:
Which should have been a safe assumption based on the types, but raises an error.
Code snippets
OS
Windows 11
Python version
3.14
Library version
2.32