Class WebSearchPreviewTool
-
- All Implemented Interfaces:
public final class WebSearchPreviewTool
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
WebSearchPreviewTool.Builder
A builder for WebSearchPreviewTool.
public final class
WebSearchPreviewTool.Type
The type of the web search tool. One of
web_search_preview
orweb_search_preview_2025_03_11
.public final class
WebSearchPreviewTool.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
WebSearchPreviewTool.UserLocation
The user's location.
-
Method Summary
-
-
Method Detail
-
type
final WebSearchPreviewTool.Type type()
The type of the web search tool. One of
web_search_preview
orweb_search_preview_2025_03_11
.
-
searchContextSize
final Optional<WebSearchPreviewTool.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<WebSearchPreviewTool.UserLocation> userLocation()
The user's location.
-
_type
final JsonField<WebSearchPreviewTool.Type> _type()
Returns the raw JSON value of type.
Unlike type, this method doesn't throw if the JSON field has an unexpected type.
-
_searchContextSize
final JsonField<WebSearchPreviewTool.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<WebSearchPreviewTool.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 WebSearchPreviewTool.Builder toBuilder()
-
validate
final WebSearchPreviewTool validate()
-
builder
final static WebSearchPreviewTool.Builder builder()
Returns a mutable builder for constructing an instance of WebSearchPreviewTool.
The following fields are required:
.type()
-
-
-
-