Google VertexAI Tool Calling

Overview

You can use this Snap to provide external tools for the model to call, supplying internal data and information for the model's responses.


Google Gemini API Tool Calling Overview

Prerequisites

Limitations

  • gemini-1.0-pro and gemini-1.5-pro is not supported for the Top K field.
  • When using OpenAPI tools type, the Snap throws errors for circular references, unsupported schema fields, or unsupported Gemini models.
  • When defining function parameters using JSON schema within OpenAPI tools, Google Gemini supports only specific keywords and directly processes and reports errors for unsupported keywords.

Snap views

View Description Examples of upstream and downstream Snaps
Input This Snap supports exactly one document input view. The input has a message list that contains the conversation history, a tool definition list, and other query parameters to the Google VertexAI Generate.
Output This Snap supports exactly two document output views.
  • The first output displays the full response from the LLM.
  • The second output displays the list of tools called.
Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution Stops the current pipeline execution when an error occurs.
  • Discard Error Data and Continue Ignores the error, discards that record, and continues with the remaining records.
  • Route Error Data to Error View Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap settings

Legend:
  • Expression icon (): Allows using JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field / Field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: Google VertexAI Gemini Tool Calling

Example: Agent worker tool caller

Model name String/Expression/ Suggestion

Required. The model name to use for Gemini API.

Default value: N/A

Example: gemini-2.0-flash
Model location String/Expression/ Suggestion

The location of the model.

Default value: N/A

Example: us-central1
Content payload String/Expression

Required. Specify the content payload to send to the Gemini text generation endpoint for all contents. Contents coming from the Prompt Generator Snap will be correctly formatted.

Default value: N/A

Example:
[{"content":"What is the weather of San Francisco?","sl_role":"USER"}] 
Tool payload String/Expression

Required. The list of tool definitions to send to the model.

Default value: N/A

Example:
[{"sl_type":"function","name":"get_weather","description":"Get the current weather in a given location","parameters":[{"name":"city","type":"STRING","description":"The city and state, e.g. San Francisco, CA","required":false}]}]
Tool configurations

Modify the tool call settings to guide the model responses and optimize output processing.

Function calling mode Dropdown list/Expression

Required. Specifies the mode in which function calling should execute.

  • AUTO
  • ANY
  • NONE

Default value: AUTO

Example: AUTO

Allowed function names String/Expression

Required. Specify a set of function names that limit the functions the model can call.

Default value: N/A

Example:
["get_weather","get_air_pollution"]
Model parameters

Parameters used to tune the model runtime.

Top K Integer/Expression

The number of high-probability tokens considered for each generation step, controlling the randomness of the output. If left blank, the endpoint uses its default value.

Default value: N/A

Example: 20
Stop sequences String/Expression

Sequence of tokens to stop the completion at.

Default value: N/A

Example: .pay, ["amazing"], ["September", "paycheck"]
Temperature Decimal/Expression

The sampling temperature to use, a decimal value between 0 and 1. If left blank, the endpoint uses its default value.

Default value: N/A

Example: 0.2
Maximum tokens Integer/Expression

Maximum number of tokens that can be generated in the Gemini text generation foundation model. If left blank, the endpoint uses its default value.

Default value: N/A

Example: 50
Top P Decimal/Expression

The nucleus sampling value, which must be a decimal between 0 and 1. If left blank, the endpoint uses its default value.

Default value: N/A

Example: 0.2
Advanced prompt configurations

Configure the advanced prompt settings.

System prompt String/Expression

Specify the persona for the model to adopt in the responses. This initial instruction guides the LLM's responses and actions.

Default value: N/A

Example:
  • "You are a helpful assistant."
  • "You are an experienced software developer."
  • "You are a customer service representative for a tech company."
Snap execution Dropdown list
Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Validate & Execute

Example: Execute only