Class Tool.Builder (3.42.0)

public static final class Tool.Builder extends GeneratedMessageV3.Builder<Tool.Builder> implements ToolOrBuilder

Tool details that the model may use to generate response.

A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. A Tool object should contain exactly one type of Tool (e.g FunctionDeclaration, Retrieval or GoogleSearchRetrieval).

Protobuf type google.cloud.aiplatform.v1beta1.Tool

Implements

ToolOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllFunctionDeclarations(Iterable<? extends FunctionDeclaration> values)

public Tool.Builder addAllFunctionDeclarations(Iterable<? extends FunctionDeclaration> values)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.aiplatform.v1beta1.FunctionDeclaration>
Returns
TypeDescription
Tool.Builder

addFunctionDeclarations(FunctionDeclaration value)

public Tool.Builder addFunctionDeclarations(FunctionDeclaration value)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueFunctionDeclaration
Returns
TypeDescription
Tool.Builder

addFunctionDeclarations(FunctionDeclaration.Builder builderForValue)

public Tool.Builder addFunctionDeclarations(FunctionDeclaration.Builder builderForValue)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
builderForValueFunctionDeclaration.Builder
Returns
TypeDescription
Tool.Builder

addFunctionDeclarations(int index, FunctionDeclaration value)

public Tool.Builder addFunctionDeclarations(int index, FunctionDeclaration value)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
indexint
valueFunctionDeclaration
Returns
TypeDescription
Tool.Builder

addFunctionDeclarations(int index, FunctionDeclaration.Builder builderForValue)

public Tool.Builder addFunctionDeclarations(int index, FunctionDeclaration.Builder builderForValue)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
indexint
builderForValueFunctionDeclaration.Builder
Returns
TypeDescription
Tool.Builder

addFunctionDeclarationsBuilder()

public FunctionDeclaration.Builder addFunctionDeclarationsBuilder()

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
FunctionDeclaration.Builder

addFunctionDeclarationsBuilder(int index)

public FunctionDeclaration.Builder addFunctionDeclarationsBuilder(int index)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint
Returns
TypeDescription
FunctionDeclaration.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Tool.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Tool.Builder
Overrides

build()

public Tool build()
Returns
TypeDescription
Tool

buildPartial()

public Tool buildPartial()
Returns
TypeDescription
Tool

clear()

public Tool.Builder clear()
Returns
TypeDescription
Tool.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Tool.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Tool.Builder
Overrides

clearFunctionDeclarations()

public Tool.Builder clearFunctionDeclarations()

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Tool.Builder

clearGoogleSearchRetrieval()

public Tool.Builder clearGoogleSearchRetrieval()

Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.

.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Tool.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public Tool.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Tool.Builder
Overrides

clearRetrieval()

public Tool.Builder clearRetrieval()

Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.

.google.cloud.aiplatform.v1beta1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Tool.Builder

clone()

public Tool.Builder clone()
Returns
TypeDescription
Tool.Builder
Overrides

getDefaultInstanceForType()

public Tool getDefaultInstanceForType()
Returns
TypeDescription
Tool

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getFunctionDeclarations(int index)

public FunctionDeclaration getFunctionDeclarations(int index)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint
Returns
TypeDescription
FunctionDeclaration

getFunctionDeclarationsBuilder(int index)

public FunctionDeclaration.Builder getFunctionDeclarationsBuilder(int index)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint
Returns
TypeDescription
FunctionDeclaration.Builder

getFunctionDeclarationsBuilderList()

public List<FunctionDeclaration.Builder> getFunctionDeclarationsBuilderList()

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
List<Builder>

getFunctionDeclarationsCount()

public int getFunctionDeclarationsCount()

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

getFunctionDeclarationsList()

public List<FunctionDeclaration> getFunctionDeclarationsList()

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
List<FunctionDeclaration>

getFunctionDeclarationsOrBuilder(int index)

public FunctionDeclarationOrBuilder getFunctionDeclarationsOrBuilder(int index)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint
Returns
TypeDescription
FunctionDeclarationOrBuilder

getFunctionDeclarationsOrBuilderList()

public List<? extends FunctionDeclarationOrBuilder> getFunctionDeclarationsOrBuilderList()

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
List<? extends com.google.cloud.aiplatform.v1beta1.FunctionDeclarationOrBuilder>

getGoogleSearchRetrieval()

public GoogleSearchRetrieval getGoogleSearchRetrieval()

Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.

.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
GoogleSearchRetrieval

The googleSearchRetrieval.

getGoogleSearchRetrievalBuilder()

public GoogleSearchRetrieval.Builder getGoogleSearchRetrievalBuilder()

Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.

.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
GoogleSearchRetrieval.Builder

getGoogleSearchRetrievalOrBuilder()

public GoogleSearchRetrievalOrBuilder getGoogleSearchRetrievalOrBuilder()

Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.

.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
GoogleSearchRetrievalOrBuilder

getRetrieval()

public Retrieval getRetrieval()

Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.

.google.cloud.aiplatform.v1beta1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Retrieval

The retrieval.

getRetrievalBuilder()

public Retrieval.Builder getRetrievalBuilder()

Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.

.google.cloud.aiplatform.v1beta1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Retrieval.Builder

getRetrievalOrBuilder()

public RetrievalOrBuilder getRetrievalOrBuilder()

Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.

.google.cloud.aiplatform.v1beta1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
RetrievalOrBuilder

hasGoogleSearchRetrieval()

public boolean hasGoogleSearchRetrieval()

Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.

.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the googleSearchRetrieval field is set.

hasRetrieval()

public boolean hasRetrieval()

Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.

.google.cloud.aiplatform.v1beta1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the retrieval field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Tool other)

public Tool.Builder mergeFrom(Tool other)
Parameter
NameDescription
otherTool
Returns
TypeDescription
Tool.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Tool.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Tool.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Tool.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Tool.Builder
Overrides

mergeGoogleSearchRetrieval(GoogleSearchRetrieval value)

public Tool.Builder mergeGoogleSearchRetrieval(GoogleSearchRetrieval value)

Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.

.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueGoogleSearchRetrieval
Returns
TypeDescription
Tool.Builder

mergeRetrieval(Retrieval value)

public Tool.Builder mergeRetrieval(Retrieval value)

Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.

.google.cloud.aiplatform.v1beta1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueRetrieval
Returns
TypeDescription
Tool.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Tool.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Tool.Builder
Overrides

removeFunctionDeclarations(int index)

public Tool.Builder removeFunctionDeclarations(int index)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint
Returns
TypeDescription
Tool.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Tool.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Tool.Builder
Overrides

setFunctionDeclarations(int index, FunctionDeclaration value)

public Tool.Builder setFunctionDeclarations(int index, FunctionDeclaration value)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
indexint
valueFunctionDeclaration
Returns
TypeDescription
Tool.Builder

setFunctionDeclarations(int index, FunctionDeclaration.Builder builderForValue)

public Tool.Builder setFunctionDeclarations(int index, FunctionDeclaration.Builder builderForValue)

Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

repeated .google.cloud.aiplatform.v1beta1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
indexint
builderForValueFunctionDeclaration.Builder
Returns
TypeDescription
Tool.Builder

setGoogleSearchRetrieval(GoogleSearchRetrieval value)

public Tool.Builder setGoogleSearchRetrieval(GoogleSearchRetrieval value)

Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.

.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueGoogleSearchRetrieval
Returns
TypeDescription
Tool.Builder

setGoogleSearchRetrieval(GoogleSearchRetrieval.Builder builderForValue)

public Tool.Builder setGoogleSearchRetrieval(GoogleSearchRetrieval.Builder builderForValue)

Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.

.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
builderForValueGoogleSearchRetrieval.Builder
Returns
TypeDescription
Tool.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Tool.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Tool.Builder
Overrides

setRetrieval(Retrieval value)

public Tool.Builder setRetrieval(Retrieval value)

Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.

.google.cloud.aiplatform.v1beta1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueRetrieval
Returns
TypeDescription
Tool.Builder

setRetrieval(Retrieval.Builder builderForValue)

public Tool.Builder setRetrieval(Retrieval.Builder builderForValue)

Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.

.google.cloud.aiplatform.v1beta1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
builderForValueRetrieval.Builder
Returns
TypeDescription
Tool.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final Tool.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Tool.Builder
Overrides