Class WebSearchTool20260318
-
- All Implemented Interfaces:
public final class WebSearchTool20260318
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classWebSearchTool20260318.BuilderA builder for WebSearchTool20260318.
public final classWebSearchTool20260318.AllowedCallerSpecifies who can invoke a tool.
Values: direct: The model can call this tool directly. code_execution_20250825: The tool can be called from the code execution environment (v1). code_execution_20260120: The tool can be called from the code execution environment (v2 with persistence). code_execution_20260521: The tool can be called from the code execution environment (v2 with persistence).
public final classWebSearchTool20260318.ResponseInclusionHow this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
-
Method Summary
Modifier and Type Method Description final Optional<List<WebSearchTool20260318.AllowedCaller>>allowedCallers()final Optional<List<String>>allowedDomains()If provided, only these domains will be included in results. final Optional<List<String>>blockedDomains()If provided, these domains will never appear in results. final Optional<CacheControlEphemeral>cacheControl()Create a cache control breakpoint at this content block. final Optional<Boolean>deferLoading()If true, tool will not be included in initial system prompt. final Optional<Long>maxUses()Maximum number of times the tool can be used in the API request. final Optional<WebSearchTool20260318.ResponseInclusion>responseInclusion()How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. final Optional<Boolean>strict()When true, guarantees schema validation on tool names and inputs final Optional<UserLocation>userLocation()Parameters for the user's location. final JsonValue_name()Name of the tool. final JsonValue_type()Expected to always return the following:
However, this method can be useful for debugging and logging (e.g.JsonValue.from("web_search_20260318")final JsonField<List<WebSearchTool20260318.AllowedCaller>>_allowedCallers()Returns the raw JSON value of allowedCallers. final JsonField<List<String>>_allowedDomains()Returns the raw JSON value of allowedDomains. final JsonField<List<String>>_blockedDomains()Returns the raw JSON value of blockedDomains. final JsonField<CacheControlEphemeral>_cacheControl()Returns the raw JSON value of cacheControl. final JsonField<Boolean>_deferLoading()Returns the raw JSON value of deferLoading. final JsonField<Long>_maxUses()Returns the raw JSON value of maxUses. final JsonField<WebSearchTool20260318.ResponseInclusion>_responseInclusion()Returns the raw JSON value of responseInclusion. final JsonField<Boolean>_strict()Returns the raw JSON value of strict. final JsonField<UserLocation>_userLocation()Returns the raw JSON value of userLocation. final Map<String, JsonValue>_additionalProperties()final WebSearchTool20260318.BuildertoBuilder()final WebSearchTool20260318validate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static WebSearchTool20260318.Builderbuilder()Returns a mutable builder for constructing an instance of WebSearchTool20260318. -
-
Method Detail
-
allowedCallers
final Optional<List<WebSearchTool20260318.AllowedCaller>> allowedCallers()
-
allowedDomains
final Optional<List<String>> allowedDomains()
If provided, only these domains will be included in results. Cannot be used alongside
blocked_domains.
-
blockedDomains
final Optional<List<String>> blockedDomains()
If provided, these domains will never appear in results. Cannot be used alongside
allowed_domains.
-
cacheControl
final Optional<CacheControlEphemeral> cacheControl()
Create a cache control breakpoint at this content block.
-
deferLoading
final Optional<Boolean> deferLoading()
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
-
maxUses
final Optional<Long> maxUses()
Maximum number of times the tool can be used in the API request.
-
responseInclusion
final Optional<WebSearchTool20260318.ResponseInclusion> responseInclusion()
How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.
-
strict
final Optional<Boolean> strict()
When true, guarantees schema validation on tool names and inputs
-
userLocation
final Optional<UserLocation> userLocation()
Parameters for the user's location. Used to provide more relevant search results.
-
_name
final JsonValue _name()
Name of the tool.
This is how the tool will be called by the model and in
tool_useblocks.Expected to always return the following:
JsonValue.from("web_search")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_type
final JsonValue _type()
Expected to always return the following:
JsonValue.from("web_search_20260318")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_allowedCallers
final JsonField<List<WebSearchTool20260318.AllowedCaller>> _allowedCallers()
Returns the raw JSON value of allowedCallers.
Unlike allowedCallers, this method doesn't throw if the JSON field has an unexpected type.
-
_allowedDomains
final JsonField<List<String>> _allowedDomains()
Returns the raw JSON value of allowedDomains.
Unlike allowedDomains, this method doesn't throw if the JSON field has an unexpected type.
-
_blockedDomains
final JsonField<List<String>> _blockedDomains()
Returns the raw JSON value of blockedDomains.
Unlike blockedDomains, this method doesn't throw if the JSON field has an unexpected type.
-
_cacheControl
final JsonField<CacheControlEphemeral> _cacheControl()
Returns the raw JSON value of cacheControl.
Unlike cacheControl, this method doesn't throw if the JSON field has an unexpected type.
-
_deferLoading
final JsonField<Boolean> _deferLoading()
Returns the raw JSON value of deferLoading.
Unlike deferLoading, this method doesn't throw if the JSON field has an unexpected type.
-
_maxUses
final JsonField<Long> _maxUses()
Returns the raw JSON value of maxUses.
Unlike maxUses, this method doesn't throw if the JSON field has an unexpected type.
-
_responseInclusion
final JsonField<WebSearchTool20260318.ResponseInclusion> _responseInclusion()
Returns the raw JSON value of responseInclusion.
Unlike responseInclusion, this method doesn't throw if the JSON field has an unexpected type.
-
_strict
final JsonField<Boolean> _strict()
Returns the raw JSON value of strict.
Unlike strict, this method doesn't throw if the JSON field has an unexpected type.
-
_userLocation
final JsonField<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 WebSearchTool20260318.Builder toBuilder()
-
validate
final WebSearchTool20260318 validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static WebSearchTool20260318.Builder builder()
Returns a mutable builder for constructing an instance of WebSearchTool20260318.
-
-
-
-