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.v1.Tool
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
public static final Descriptors.Descriptor getDescriptor()
Methods
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
Parameter |
Name |
Description |
values |
Iterable<? extends com.google.cloud.aiplatform.v1.FunctionDeclaration>
|
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
Parameter |
Name |
Description |
index |
int
|
public Tool.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
Returns |
Type |
Description |
Tool |
|
public Tool buildPartial()
Returns |
Type |
Description |
Tool |
|
public Tool.Builder clear()
Overrides
public Tool.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
public Tool.Builder clearGoogleSearchRetrieval()
Optional. GoogleSearchRetrieval tool type.
Specialized retrieval tool that is powered by Google search.
.google.cloud.aiplatform.v1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];
public Tool.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
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.v1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];
public Tool.Builder clone()
Overrides
public Tool getDefaultInstanceForType()
Returns |
Type |
Description |
Tool |
|
public Descriptors.Descriptor getDescriptorForType()
Overrides
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
Parameter |
Name |
Description |
index |
int
|
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
Parameter |
Name |
Description |
index |
int
|
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
Returns |
Type |
Description |
int |
|
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
Parameter |
Name |
Description |
index |
int
|
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
Returns |
Type |
Description |
List<? extends com.google.cloud.aiplatform.v1.FunctionDeclarationOrBuilder> |
|
public GoogleSearchRetrieval getGoogleSearchRetrieval()
Optional. GoogleSearchRetrieval tool type.
Specialized retrieval tool that is powered by Google search.
.google.cloud.aiplatform.v1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];
public GoogleSearchRetrieval.Builder getGoogleSearchRetrievalBuilder()
Optional. GoogleSearchRetrieval tool type.
Specialized retrieval tool that is powered by Google search.
.google.cloud.aiplatform.v1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];
public GoogleSearchRetrievalOrBuilder getGoogleSearchRetrievalOrBuilder()
Optional. GoogleSearchRetrieval tool type.
Specialized retrieval tool that is powered by Google search.
.google.cloud.aiplatform.v1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];
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.v1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];
Returns |
Type |
Description |
Retrieval |
The retrieval.
|
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.v1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];
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.v1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];
public boolean hasGoogleSearchRetrieval()
Optional. GoogleSearchRetrieval tool type.
Specialized retrieval tool that is powered by Google search.
.google.cloud.aiplatform.v1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];
Returns |
Type |
Description |
boolean |
Whether the googleSearchRetrieval field is set.
|
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.v1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];
Returns |
Type |
Description |
boolean |
Whether the retrieval field is set.
|
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
public final boolean isInitialized()
Overrides
public Tool.Builder mergeFrom(Tool other)
Parameter |
Name |
Description |
other |
Tool
|
public Tool.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
public Tool.Builder mergeFrom(Message other)
Parameter |
Name |
Description |
other |
Message
|
Overrides
public Tool.Builder mergeGoogleSearchRetrieval(GoogleSearchRetrieval value)
Optional. GoogleSearchRetrieval tool type.
Specialized retrieval tool that is powered by Google search.
.google.cloud.aiplatform.v1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];
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.v1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];
public final Tool.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
Parameter |
Name |
Description |
index |
int
|
public Tool.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
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 128 function declarations can be provided.
repeated .google.cloud.aiplatform.v1.FunctionDeclaration function_declarations = 1 [(.google.api.field_behavior) = OPTIONAL];
public Tool.Builder setGoogleSearchRetrieval(GoogleSearchRetrieval value)
Optional. GoogleSearchRetrieval tool type.
Specialized retrieval tool that is powered by Google search.
.google.cloud.aiplatform.v1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];
public Tool.Builder setGoogleSearchRetrieval(GoogleSearchRetrieval.Builder builderForValue)
Optional. GoogleSearchRetrieval tool type.
Specialized retrieval tool that is powered by Google search.
.google.cloud.aiplatform.v1.GoogleSearchRetrieval google_search_retrieval = 3 [(.google.api.field_behavior) = OPTIONAL];
public Tool.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
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.v1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];
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.v1.Retrieval retrieval = 2 [(.google.api.field_behavior) = OPTIONAL];
public final Tool.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides