Skip to content

ResponseFunctionWebSearch doesn't match returned payload #3179

Description

@davidgilbertson

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)

Image

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions