Skip to main content
The OpenAI Responses provider exposes a web search tool that allows you to search the web and weave the results into your responses. The web search tool can be enabled via the chatModelOptions parameter of the Agent constructor:
Use OpenAIServerSideTool.webSearch to turn the tool on for a request. Each chunk includes the streaming progress events under metadata['web_search'].

Configure Context

Configuration controls:
  • contextSize tunes how much context the provider should gather (low/medium/ high/other)
  • followupQuestions requests suggested follow-ups in metadata where supported
  • location nudges the search toward a city/region/country/time zone

Metadata Structure

The metadata list contains chronological events streamed by the provider. Each entry includes:
  • type: the event identifier (e.g. response.web_search_call.started)
  • query: text of the query that ran
  • results: snippets or URLs when the provider shares them
Use these events to show a progress panel or capture citations. Because they arrive in metadata, they never pollute the chat transcript.

Example