Class WebSearchTool
-
- All Implemented Interfaces:
public final class WebSearchTool
Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
WebSearchTool.Builder
A builder for WebSearchTool.
public final class
WebSearchTool.Type
The type of the web search tool. One of
web_search
orweb_search_2025_08_26
.public final class
WebSearchTool.Filters
Filters for the search.
public final class
WebSearchTool.SearchContextSize
High level guidance for the amount of context window space to use for the search. One of
low
,medium
, orhigh
.medium
is the default.public final class
WebSearchTool.UserLocation
The approximate location of the user.
-
Method Summary
Modifier and Type Method Description final WebSearchTool.Type
type()
The type of the web search tool. final Optional<WebSearchTool.Filters>
filters()
Filters for the search. final Optional<WebSearchTool.SearchContextSize>
searchContextSize()
High level guidance for the amount of context window space to use for the search. final Optional<WebSearchTool.UserLocation>
userLocation()
The approximate location of the user. final JsonField<WebSearchTool.Type>
_type()
Returns the raw JSON value of type. final JsonField<WebSearchTool.Filters>
_filters()
Returns the raw JSON value of filters. final JsonField<WebSearchTool.SearchContextSize>
_searchContextSize()
Returns the raw JSON value of searchContextSize. final JsonField<WebSearchTool.UserLocation>
_userLocation()
Returns the raw JSON value of userLocation. final Map<String, JsonValue>
_additionalProperties()
final WebSearchTool.Builder
toBuilder()
final WebSearchTool
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static WebSearchTool.Builder
builder()
Returns a mutable builder for constructing an instance of WebSearchTool. -
-
Method Detail
-
type
final WebSearchTool.Type type()
The type of the web search tool. One of
web_search
orweb_search_2025_08_26
.
-
filters
final Optional<WebSearchTool.Filters> filters()
Filters for the search.
-
searchContextSize
final Optional<WebSearchTool.SearchContextSize> searchContextSize()
High level guidance for the amount of context window space to use for the search. One of
low
,medium
, orhigh
.medium
is the default.
-
userLocation
final Optional<WebSearchTool.UserLocation> userLocation()
The approximate location of the user.
-
_type
final JsonField<WebSearchTool.Type> _type()
Returns the raw JSON value of type.
Unlike type, this method doesn't throw if the JSON field has an unexpected type.
-
_filters
final JsonField<WebSearchTool.Filters> _filters()
Returns the raw JSON value of filters.
Unlike filters, this method doesn't throw if the JSON field has an unexpected type.
-
_searchContextSize
final JsonField<WebSearchTool.SearchContextSize> _searchContextSize()
Returns the raw JSON value of searchContextSize.
Unlike searchContextSize, this method doesn't throw if the JSON field has an unexpected type.
-
_userLocation
final JsonField<WebSearchTool.UserLocation> _userLocation()
Returns the raw JSON value of userLocation.
Unlike userLocation, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final WebSearchTool.Builder toBuilder()
-
validate
final WebSearchTool validate()
-
builder
final static WebSearchTool.Builder builder()
Returns a mutable builder for constructing an instance of WebSearchTool.
The following fields are required:
.type()
-
-
-
-