diff --git a/src/openai/types/beta/beta_response_function_web_search.py b/src/openai/types/beta/beta_response_function_web_search.py index 0d1a20e401..b59f9f0fa2 100644 --- a/src/openai/types/beta/beta_response_function_web_search.py +++ b/src/openai/types/beta/beta_response_function_web_search.py @@ -86,10 +86,13 @@ class BetaResponseFunctionWebSearch(BaseModel): id: str """The unique ID of the web search tool call.""" - action: Action + action: Optional[Action] = None """ An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page). + + May be `None` when the web search call did not produce a specific action (e.g. some + completed calls return no `action` in the API response). """ status: Literal["in_progress", "searching", "completed", "failed"] diff --git a/src/openai/types/responses/response_function_web_search.py b/src/openai/types/responses/response_function_web_search.py index 3584992b7d..9d6c55ab5a 100644 --- a/src/openai/types/responses/response_function_web_search.py +++ b/src/openai/types/responses/response_function_web_search.py @@ -78,10 +78,13 @@ class ResponseFunctionWebSearch(BaseModel): id: str """The unique ID of the web search tool call.""" - action: Action + action: Optional[Action] = None """ An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page). + + May be `None` when the web search call did not produce a specific action (e.g. some + completed calls return no `action` in the API response). """ status: Literal["in_progress", "searching", "completed", "failed"]