Skip to content

TypeError: 'ActionSearch' object is not subscriptable (deep research API) #1937

@loopasam

Description

@loopasam

Notebook containing the bug: https://github.com/openai/openai-cookbook/blob/main/examples/deep_research_api/introduction_to_deep_research_api.ipynb

This block:

# Find the first web search step
search = next(item for item in response.output if item.type == "web_search_call")
print("Query:", search.action["query"])
print("Status:", search.status)

Produces an error: TypeError: 'ActionSearch' object is not subscriptable

Fix: Use object dot notation instead, replace

search.action["query"] with search.action.query

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions