class

OpenAI::WebSearchTool

Inherits JSON::Serializable < Reference < Object

Search the Internet for sources related to the prompt. Learn more about the web search tool.

Constructors

new(type_value : WebSearchToolType = WebSearchToolType::WebSearch, filters : WebSearchToolFilters | Nil = nil, user_location : WebSearchApproximateLocation | Nil = nil, search_context_size : WebSearchToolSearchContextSize | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

filters
Source
filters=(filters : WebSearchToolFilters | Nil)
Source
search_context_size

High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.

Source
search_context_size=(search_context_size : WebSearchToolSearchContextSize | Nil)

High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.

Source
type_value

The type of the web search tool. One of web_search or web_search_2025_08_26.

Source
type_value=(type_value : WebSearchToolType)

The type of the web search tool. One of web_search or web_search_2025_08_26.

Source
user_location
Source
user_location=(user_location : WebSearchApproximateLocation | Nil)
Source