Skip to content

fix(types): make ResponseFunctionWebSearch.action optional#3481

Open
gautamkishore wants to merge 1 commit into
openai:mainfrom
gautamkishore:fix/3179-websearch-action-optional
Open

fix(types): make ResponseFunctionWebSearch.action optional#3481
gautamkishore wants to merge 1 commit into
openai:mainfrom
gautamkishore:fix/3179-websearch-action-optional

Conversation

@gautamkishore

Copy link
Copy Markdown

The API returns action=None for some completed web search calls, but the response type declares action as required. This makes attribute access such as item.action.type break under strict typing (and raises at runtime for users who assumed the field is always present).

Make action Optional[Action] = None in both the stable and beta response types so the model matches the actual API payload.

Fixes #3179

The API returns action=None for some completed web search calls, but the type declares action as required, causing attribute access (e.g. item.action.type) to break under strict typing.

Make action Optional[Action] = None in both the stable and beta response types.

Fixes openai#3179
@gautamkishore gautamkishore requested a review from a team as a code owner July 10, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ResponseFunctionWebSearch doesn't match returned payload

1 participant