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).
JSON representation |
---|
{ "functionDeclarations": [ { object ( |
Fields | |
---|---|
functionDeclarations[] |
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][content.part.function_call] in the response. user should provide a [FunctionResponse][content.part.function_response] 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. |
retrieval |
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. |
Retrieval
Defines a retrieval tool that model can call to access external knowledge.
JSON representation |
---|
{ "disableAttribution": boolean, // Union field |
Fields | |
---|---|
disableAttribution |
Optional. Disable using the result from this tool in detecting grounding attribution. This does not affect how the result is given to the model for generation. |
Union field source . The source of the retrieval. source can be only one of the following: |
|
vertexAiSearch |
Set to use data source powered by Vertex AI Search. |
vertexRagStore |
Set to use data source powered by Vertex RAG store. user data is uploaded via the VertexRagDataService. |
VertexAISearch
Retrieve from Vertex AI Search datastore for grounding. See https://cloud.google.com/vertex-ai-search-and-conversation
JSON representation |
---|
{ "datastore": string } |
Fields | |
---|---|
datastore |
Required. Fully-qualified Vertex AI Search's datastore resource ID. Format: |
VertexRagStore
Retrieve from Vertex RAG Store for grounding.
JSON representation |
---|
{
"ragCorpora": [
string
],
"ragResources": [
{
object ( |
Fields | |
---|---|
ragCorpora[] |
Optional. Deprecated. Please use ragResources instead. |
ragResources[] |
Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support. |
similarityTopK |
Optional. Number of top k results to return from the selected corpora. |
vectorDistanceThreshold |
Optional. Only return results with vector distance smaller than the threshold. |
RagResource
The definition of the Rag resource.
JSON representation |
---|
{ "ragCorpus": string, "ragFileIds": [ string ] } |
Fields | |
---|---|
ragCorpus |
Optional. RagCorpora resource name. Format: |
ragFileIds[] |
Optional. ragFileId. The files should be in the same ragCorpus set in ragCorpus field. |