Implementation:Openai Openai python Response Web Search In Progress
| 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 initiated during a streaming response, provided by the openai-python SDK.
Description
ResponseWebSearchCallInProgressEvent is a Pydantic model representing the response.web_search_call.in_progress streaming event. It is emitted when the model initiates a web search tool call. The event carries item_id identifying the output item associated with the search, output_index for positional context, and sequence_number for stream ordering.
Usage
Import this type when you need to detect the start of a web search operation during a streaming response, for example to display a loading indicator in a UI.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/responses/response_web_search_call_in_progress_event.py
Signature
class ResponseWebSearchCallInProgressEvent(BaseModel):
"""Emitted when a web search call is initiated."""
item_id: str
output_index: int
sequence_number: int
type: Literal["response.web_search_call.in_progress"]
Import
from openai.types.responses import ResponseWebSearchCallInProgressEvent
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.in_progress"] | Yes | The type of the event. Always response.web_search_call.in_progress.
|
Usage Examples
import openai
client = openai.OpenAI()
stream = client.responses.create(
model="gpt-4o",
input="What are the latest developments in fusion energy?",
tools=[{"type": "web_search_preview"}],
stream=True,
)
for event in stream:
if event.type == "response.web_search_call.in_progress":
print(f"Web search initiated for item {event.item_id}...")