Implementation:Openai Openai python Response Web Search Searching
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Responses_API |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete type for representing an event emitted when a web search call is actively executing during a streaming response, provided by the openai-python SDK.
Description
ResponseWebSearchCallSearchingEvent is a Pydantic model representing the response.web_search_call.searching streaming event. It is emitted while the web search tool is actively executing a search query. The event carries item_id identifying the output item, output_index for positional context, and sequence_number for stream ordering.
Usage
Import this type when you need to track the active searching phase of a web search tool call during streaming, for example to update a status indicator.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/responses/response_web_search_call_searching_event.py
Signature
class ResponseWebSearchCallSearchingEvent(BaseModel):
"""Emitted when a web search call is executing."""
item_id: str
output_index: int
sequence_number: int
type: Literal["response.web_search_call.searching"]
Import
from openai.types.responses import ResponseWebSearchCallSearchingEvent
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| item_id | str | Yes | Unique ID for the output item associated with the web search call. |
| output_index | int | Yes | The index of the output item that the web search call is associated with. |
| sequence_number | int | Yes | The sequence number of the web search call being processed. |
| type | Literal["response.web_search_call.searching"] | Yes | The type of the event. Always response.web_search_call.searching.
|
Usage Examples
import openai
client = openai.OpenAI()
stream = client.responses.create(
model="gpt-4o",
input="Find the current weather in Tokyo.",
tools=[{"type": "web_search_preview"}],
stream=True,
)
for event in stream:
if event.type == "response.web_search_call.searching":
print(f"Searching the web (item {event.item_id})...")