Class Tool.Builder
-
- All Implemented Interfaces:
public final class Tool.BuilderA builder for Tool.
-
-
Method Summary
Modifier and Type Method Description final Tool.BuilderinputSchema(Tool.InputSchema inputSchema)JSON schema for this tool's input. final Tool.BuilderinputSchema(JsonField<Tool.InputSchema> inputSchema)Sets Builder.inputSchema to an arbitrary JSON value. final Tool.Buildername(String name)Name of the tool. final Tool.Buildername(JsonField<String> name)Sets Builder.name to an arbitrary JSON value. final Tool.BuilderallowedCallers(List<Tool.AllowedCaller> allowedCallers)final Tool.BuilderallowedCallers(JsonField<List<Tool.AllowedCaller>> allowedCallers)Sets Builder.allowedCallers to an arbitrary JSON value. final Tool.BuilderaddAllowedCaller(Tool.AllowedCaller allowedCaller)Adds a single AllowedCaller to allowedCallers. final Tool.BuildercacheControl(CacheControlEphemeral cacheControl)Create a cache control breakpoint at this content block. final Tool.BuildercacheControl(Optional<CacheControlEphemeral> cacheControl)Alias for calling Builder.cacheControl with cacheControl.orElse(null).final Tool.BuildercacheControl(JsonField<CacheControlEphemeral> cacheControl)Sets Builder.cacheControl to an arbitrary JSON value. final Tool.BuilderdeferLoading(Boolean deferLoading)If true, tool will not be included in initial system prompt. final Tool.BuilderdeferLoading(JsonField<Boolean> deferLoading)Sets Builder.deferLoading to an arbitrary JSON value. final Tool.Builderdescription(String description)Description of what this tool does. final Tool.Builderdescription(JsonField<String> description)Sets Builder.description to an arbitrary JSON value. final Tool.BuildereagerInputStreaming(Boolean eagerInputStreaming)Enable eager input streaming for this tool. final Tool.BuildereagerInputStreaming(Boolean eagerInputStreaming)Alias for Builder.eagerInputStreaming. final Tool.BuildereagerInputStreaming(Optional<Boolean> eagerInputStreaming)Alias for calling Builder.eagerInputStreaming with eagerInputStreaming.orElse(null).final Tool.BuildereagerInputStreaming(JsonField<Boolean> eagerInputStreaming)Sets Builder.eagerInputStreaming to an arbitrary JSON value. final Tool.BuilderinputExamples(List<Tool.InputExample> inputExamples)final Tool.BuilderinputExamples(JsonField<List<Tool.InputExample>> inputExamples)Sets Builder.inputExamples to an arbitrary JSON value. final Tool.BuilderaddInputExample(Tool.InputExample inputExample)Adds a single InputExample to inputExamples. final Tool.Builderstrict(Boolean strict)When true, guarantees schema validation on tool names and inputs final Tool.Builderstrict(JsonField<Boolean> strict)Sets Builder.strict to an arbitrary JSON value. final Tool.Buildertype(Tool.Type type)final Tool.Buildertype(Optional<Tool.Type> type)Alias for calling Builder.type with type.orElse(null).final Tool.Buildertype(JsonField<Tool.Type> type)Sets Builder.type to an arbitrary JSON value. final Tool.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final Tool.BuilderputAdditionalProperty(String key, JsonValue value)final Tool.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final Tool.BuilderremoveAdditionalProperty(String key)final Tool.BuilderremoveAllAdditionalProperties(Set<String> keys)final Toolbuild()Returns an immutable instance of Tool. -
-
Method Detail
-
inputSchema
final Tool.Builder inputSchema(Tool.InputSchema inputSchema)
JSON schema for this tool's input.
This defines the shape of the
inputthat your tool accepts and that the model will produce.
-
inputSchema
final Tool.Builder inputSchema(JsonField<Tool.InputSchema> inputSchema)
Sets Builder.inputSchema to an arbitrary JSON value.
You should usually call Builder.inputSchema with a well-typed InputSchema value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
name
final Tool.Builder name(String name)
Name of the tool.
This is how the tool will be called by the model and in
tool_useblocks.
-
name
final Tool.Builder name(JsonField<String> name)
Sets Builder.name to an arbitrary JSON value.
You should usually call Builder.name with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
allowedCallers
final Tool.Builder allowedCallers(List<Tool.AllowedCaller> allowedCallers)
-
allowedCallers
final Tool.Builder allowedCallers(JsonField<List<Tool.AllowedCaller>> allowedCallers)
Sets Builder.allowedCallers to an arbitrary JSON value.
You should usually call Builder.allowedCallers with a well-typed
List<AllowedCaller>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addAllowedCaller
final Tool.Builder addAllowedCaller(Tool.AllowedCaller allowedCaller)
Adds a single AllowedCaller to allowedCallers.
-
cacheControl
final Tool.Builder cacheControl(CacheControlEphemeral cacheControl)
Create a cache control breakpoint at this content block.
-
cacheControl
final Tool.Builder cacheControl(Optional<CacheControlEphemeral> cacheControl)
Alias for calling Builder.cacheControl with
cacheControl.orElse(null).
-
cacheControl
final Tool.Builder cacheControl(JsonField<CacheControlEphemeral> cacheControl)
Sets Builder.cacheControl to an arbitrary JSON value.
You should usually call Builder.cacheControl with a well-typed CacheControlEphemeral value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
deferLoading
final Tool.Builder deferLoading(Boolean deferLoading)
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
-
deferLoading
final Tool.Builder deferLoading(JsonField<Boolean> deferLoading)
Sets Builder.deferLoading to an arbitrary JSON value.
You should usually call Builder.deferLoading with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
description
final Tool.Builder description(String description)
Description of what this tool does.
Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
-
description
final Tool.Builder description(JsonField<String> description)
Sets Builder.description to an arbitrary JSON value.
You should usually call Builder.description with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
eagerInputStreaming
final Tool.Builder eagerInputStreaming(Boolean eagerInputStreaming)
Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
-
eagerInputStreaming
final Tool.Builder eagerInputStreaming(Boolean eagerInputStreaming)
Alias for Builder.eagerInputStreaming.
This unboxed primitive overload exists for backwards compatibility.
-
eagerInputStreaming
final Tool.Builder eagerInputStreaming(Optional<Boolean> eagerInputStreaming)
Alias for calling Builder.eagerInputStreaming with
eagerInputStreaming.orElse(null).
-
eagerInputStreaming
final Tool.Builder eagerInputStreaming(JsonField<Boolean> eagerInputStreaming)
Sets Builder.eagerInputStreaming to an arbitrary JSON value.
You should usually call Builder.eagerInputStreaming with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
inputExamples
final Tool.Builder inputExamples(List<Tool.InputExample> inputExamples)
-
inputExamples
final Tool.Builder inputExamples(JsonField<List<Tool.InputExample>> inputExamples)
Sets Builder.inputExamples to an arbitrary JSON value.
You should usually call Builder.inputExamples with a well-typed
List<InputExample>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addInputExample
final Tool.Builder addInputExample(Tool.InputExample inputExample)
Adds a single InputExample to inputExamples.
-
strict
final Tool.Builder strict(Boolean strict)
When true, guarantees schema validation on tool names and inputs
-
strict
final Tool.Builder strict(JsonField<Boolean> strict)
Sets Builder.strict to an arbitrary JSON value.
You should usually call Builder.strict with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
type
final Tool.Builder type(Tool.Type type)
-
type
final Tool.Builder type(Optional<Tool.Type> type)
Alias for calling Builder.type with
type.orElse(null).
-
type
final Tool.Builder type(JsonField<Tool.Type> type)
Sets Builder.type to an arbitrary JSON value.
You should usually call Builder.type with a well-typed Type value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final Tool.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final Tool.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final Tool.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final Tool.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final Tool.Builder removeAllAdditionalProperties(Set<String> keys)
-
-
-
-