Google Vertex
The Automate Google Vertex connector leverages Vertex’s Gemini API model to generate responses based on user prompts within your automation.
Gemini models are advanced machine learning models offered by Google Vertex AI, designed to handle complex natural language tasks with high accuracy and efficiency.
These models utilize sophisticated deep learning and natural language understanding techniques for tasks such as text generation, comprehension, summarization, and more.
Prerequisites
To use the Google Vertex connector, you first need to connect your Google Vertex service account with Automate using the following steps:
- Log in to your Contentstack account and click the Automate icon from the left navigation panel.
- Select your project and then the automation.
- Click Configure Action Step from the left navigation panel and then Action Step to configure third-party services.
- Within the Choose Connector, click the Google Vertex connector.
- Under Choose an Action, select any one action from the list. Here, we are selecting the Send Prompt action.
Note: The Function Calling (Beta) and Function Calling Response (Beta) actions are currently in the Beta phase due to Google Gemini services. This status may change in the future.
- In the Configure Action section, click + Add New Account to add your Google Vertex service account.
- In the Authorize modal, provide details such as Title, and Service Account Key.
To create a service account key, follow the steps below:- Go to the Google Cloud Platform.
- Navigate to the IAM & Admin page. Select the Service Accounts section in the left navigation. You can use a pre-existing account or create a new Service Account to get the Service Account Key.
Additional Resource: For more information on getting the Service Account Key, refer to the Create Service Account documentation.
- Once done, provide the permission to access the Vertex API.
- Click the Authorize button.
This sets up your Google Vertex service account for the Google Vertex connector.
Set up the Google Vertex Connector
Perform the following steps to set up the Google Vertex connector:
- From the left navigation panel, click Configure Action Step.
- Then, click Action Step to configure third-party services.
- Within the Configure Action Step, click the Google Vertex connector.
- Under Choose an Action, you will see the actions: Function Calling (Beta), Function Calling Response (Beta), and Send Prompt.
Once done, you can start setting up your Google Vertex connector.
Function Calling (Beta)
The Function Calling (Beta) action allows you to generate the responses based on a configured Sub Automation. Within the Function Calling (Beta) action, you can include various sub automations, which the Gemini model will analyze to generate and return responses accordingly. To use the Function Calling (Beta) action, follow the steps below:
- Under Choose an Action tab, select the Function Calling (Beta) action.
- On the Function Calling (Beta) Configure Action page, enter the details given below:
- Click + Add New Account button to connect your Google Vertex service account as shown in the Prerequisites step.
- In the Select Project drop-down, select a project to use the Vertex API.
- In the Select Model drop-down, select a Gemini model to generate a response. Currently, the models available are: gemini-1.0-pro, gemini-1.0-pro-001, gemini-1.0-pro-002, gemini-1.5-flash-001, gemini-1.5-pro-001.
Additional Resource: For more information, refer to the Google AI Gemini documentation.
- Provide the Prompt Text to generate response(s).
- Click the + Add Sub Automation button to add multiple sub automations.
Note: You must create a Sub Automation to use it in the Function Calling (Beta) action.
- Click the Show Optional Fields toggle button to use the optional field.
- You can mark the Sanitize text checkbox to remove special characters or spaces from the chat response. Enabling this checkbox, eliminates any special characters or spaces in the chat response, resulting in a clean and compatible text.
- Click Proceed.
- Check if the details are correct. If yes, then click Test Action.
- You will get the response(s). Once set, click Save and Exit.
Note: The Function Calling (Beta) feature selects which Sub Automation to run from a list of multiple options and generates the input for it. In the Sub Automation action, the Sub Automation determined by the Function Calling (Beta) action is executed.
Function Calling Response (Beta)
With the Function Calling Response (Beta) action, you can format the output from the Function Calling (Beta) action and the Sub Automation. To use the Function Calling Response (Beta) action, follow the steps below:
- Under Choose an Action tab, select the Function Calling Response (Beta) action.
- On the Function Calling Response (Beta) Configure Action page, enter the details given below:
- Click + Add New Account button to connect your Google Vertex service account as shown in the Prerequisites step.
- In the Select Project drop-down, select a project to use the Vertex API.
- In the Select Model drop-down, select a Gemini model to generate a response. Currently, the models available are: gemini-1.0-pro, gemini-1.0-pro-001, gemini-1.0-pro-002, gemini-1.5-flash-001, gemini-1.5-pro-001.
Additional Resource: For more information, refer to the Google AI Gemini documentation.
- In the Function Calling Response field, select the output from the previous Function Calling action step.
- In the Sub Automation Response field, select the output from the sub automation.
- Click the Show Optional Fields toggle button to use the optional field.
You can mark the Sanitize text checkbox to remove special characters or spaces from the chat response. Enabling this checkbox eliminates any special characters or spaces in the chat response, resulting in a clean and compatible text.
- Click Proceed.
- Check if the details are correct. If yes, then click Test Action.
- You will get the response(s). Once set, click Save and Exit.
Additional Resource: Refer to the ChatGPT Use Cases to learn more about the Sub Automation action.
Send Prompt
This action returns the generated response from the Gemini API model.
- Under Choose an Action tab, select the Send Prompt action.
- On the Send Prompt Configure Action page, enter the details given below:
- Click + Add New Account button to connect your Google Vertex service account as shown in the Prerequisites step.
- In the Select Project drop-down, select a project to use the Vertex API.
- In the Select Model drop-down, select a Gemini model to generate a response. Currently, the models available are: Gemini 1.5 Pro, Gemini 1.5 Flash, and Gemini 1.0 Pro.
Additional Resource: For more information, refer to the Google AI Gemini documentation.
- In the Prompt Text field, enter a text to generate a response.
- Optionally, enable the Show Optional Fields toggle to view the optional fields.
- Enter the System Instruction Text to provide specific guidance or directives to the model to help it understand the context and generate an appropriate response based on the provided prompt text.
For example, enter What is Metaverse? in Prompt Text and Respond in Shakespeare language in System Instruction Text.
- Enter the Number of Tokens to generate the content. This must be within the range of 1 to 8192.
- Enter a value for the Randomness of Responses of the generated content. 0 being the most precise and 1 being the most random content predictions. This must be within the range of 0 to 1.
- Enter the Top-K value to define how the model selects tokens for output. Entering a Top-K value of 1 implies that the next chosen token is the most likely among all tokens in the model's vocabulary. Top-K value of 3 means that the next token is selected from the three most probable tokens using temperature. This must be within the range of 1 to 40.
- Enter the Top-P value to define how the model selects tokens for output. For instance, if tokens A, B, and C have probabilities of 0.3, 0.2, and 0.1; then entering a Top-P value as 0.5, the model chooses either A or B as the next token using temperature and excludes C. This must be within the range of 0 to 1.
- Additionally, mark the Sanitize text checkbox to remove special characters or spaces from the chat response. By enabling this checkbox, any special characters or spaces in the chat response will be eliminated, resulting in a clean and compatible text.
- Click the Proceed button.
- Click the Test Action button to test the configured action.
- Once set, click the Save and Exit button. You will see a response generated for your prompt.
This completes the Google Vertex connector’s setup.