Skip to content

Vertex AI

Category: Cognitive

Description: This extension module allows generating responses based on Google's generative AI while simultaneously evaluating cognitive capabilities using the default cognitive engine defined in the tenant. Vertex AI offers access to Gemini, a multimodal model from Google DeepMind, capable of understanding virtually any input, combining different types of information, and generating almost any output.

Functionality: Use this extension module to create responses based on Google's generative AI while simultaneously evaluating cognitive capabilities using the default cognitive engine defined in the tenant. Vertex AI offers access to Gemini, a multimodal model from Google DeepMind, capable of understanding virtually any input, combining different types of information, and generating almost any output.

Prerequisites

  1. Create a Google Account

    • If you do not have a Google account (Gmail) yet, create one on Gmail.
    • Access Google Cloud. Once you have your Google account, go to Google Cloud Console (If this is your first time accessing it, you will need to accept the terms and conditions).
    • In the Google Cloud Console, select or create a new project. To do this, click on the project dropdown menu at the top of the page and select "New Project".
  2. Enable Vertex AI:

    • Within the project, enable the Vertex AI API. Go to the navigation menu, select "APIs & Services" > "Library" and search for "Vertex AI". Click on "Enable".
  3. Train a cognitive engine

    • Refer to the documentation of the selected Cognitive Engine or try to retrieve a valid response to adjust queries during the design phase of your flow.

Note 📑: Access the Vertex AI, documentation for more information.

Implementation

Random dialog type action to continue the conversation: A list-type field that displays dialogs created in the tenant, allowing interaction to start.

Expression that defines the training prompt: A field where you must enter an expression that allows generating a response from the model based on the text. Instructions can include predicates, questions, suggestions, instructions, or examples.

LOCATION_ID: A field that uniquely identifies the specific region or zone where Vertex AI operations will be executed. This field is important for defining the geographical location of AI resources, which can affect latency, regulatory compliance, and other operational aspects. Examples of LOCATION_ID values include us-central1, europe-west1, among others.

PUBLISHER: A field that indicates the entity or provider that developed and published the AI model being used. This could be a company, a research organization, or a development team within Google Cloud.

MODEL: A string-type expression that specifies the AI model to be used for text validation. Each model has a unique identifier that must be indicated in this field. For example, text-bison@001 for a specific natural language processing model.

Note 📑: The complete list of available models and their identifiers can be found in the official Vertex AI documentation.

Temperature: A float-type field that controls the creativity of the responses generated by the AI model. A higher value (like 0.9) makes the model generate more diverse and creative responses, while a lower value (like 0) produces more precise and defined responses. Adjusting this value allows balancing between creativity and precision depending on the context of use.

MAX OUTPUT TOKENS: A field that determines the maximum number of tokens (words, parts of words, or symbols) that can be generated in the model's text output. A lower value will generate shorter and more concise responses, while a higher value will allow more extensive and detailed responses.

TOP P: Controls the diversity of the model's responses. A high value (close to 1) allows greater diversity by considering more possible options. A low value (close to 0) limits the options to the most probable ones, resulting in more coherent and less creative responses.

For example, if tokens A, B, and C have probabilities of 0.3, 0.2, and 0.1, and the top P value is 0.5, the model will select A or B as the next token (with temperature) and will not consider C. The default top P value is 0.95.

TOP K: The TOP K field controls the number of most probable token options that the model will consider at each step of text generation. A higher value will allow the model to consider a larger number of possible options, while a lower value will limit the options to the most probable ones.

Certainty (1-100) with which the intention is identified: A field that allows entering an acceptance percentage that determines the certainty with which a particular intention is identified. The value should be in a range of 1 to 100, where a higher value indicates a greater certainty that the identified intention is correct. This field is used to set a confidence threshold in intention identification.

If the maximum number of failed attempts is reached, the action flow will be interrupted, and the error description will be passed to the selected intention named: 'vertexAi_Error': A selection box where a list of intentions will be displayed, and you must select the one that will be activated in case an error occurs.

PROJECT ID: A parameter corresponding to the configuration of the Google Service Account. The PROJECT ID is a unique identifier for your project in Google Cloud. This ID is used to associate all resources and services in Google Cloud with your specific project.

PRIVATE KEY ID: A parameter corresponding to the configuration of the Google Service Account. The PRIVATE KEY ID is a unique identifier for the private key used in the authentication and authorization of the Google Service Account. This field is essential for security and secure access to Google Cloud resources.

PRIVATE KEY: A parameter corresponding to the configuration of the Google Service Account. The PRIVATE KEY is a private key used to authenticate and authorize the Google Service Account. This key must be kept secure and is used along with the PRIVATE KEY ID to secure access to Google Cloud services and resources.

CLIENT EMAIL: A parameter corresponding to the configuration of the Google Service Account. The CLIENT EMAIL is the email associated with the Google Service Account. This email identifies the service account and is used in the authentication and authorization process.

CLIENT_ID: A parameter corresponding to the configuration of the Google Service Account. The CLIENT_ID is a unique identifier for the Google Service Account. This ID is used along with other configuration parameters to authenticate and authorize the service account in Google Cloud.

Implementation Example

The following example describes the required configuration that allows generating responses based on Google's AI

Field Value
Name  PruebaVertex
Random dialog type action to continue the conversation d_askVertex ----> '¿How can I help you? '
Expression that defines the training prompt 'responde las siguientes preguntas en base a la pagina https://resources.lynn.cx/'
LOCATION_ID us-central1
PUBLISHER google
MODEL text-bison@001
Temperature 0.7
MAX OUTPUT TOKENS 150
TOP P 0.95
TOP K 40
Certainty (1-100) with which the intention is identified 85
If the maximum number of failed attempts is reached, the action flow will be interrupted, and the error description will be passed to the selected intention named: 'vertexAi_Error': Error_Handler
[PROJECT ID] my-gcp-project
[PRIVATE KEY ID] abcdef123456
[PRIVATE KEY] nMIIEvAIBADANBgkqhki
[CLIENT EMAIL] my-service-account@my-gcp-project.iam.gserviceaccount.com
[CLIENT_ID] 12345678901234567890

Output:

1. The start intention immediately executes the configuration made in the VertexAI extension module.

2. The cognitive evaluation meets the conditions to execute the intention configured in the intention's training.

3. If the configured certainty does not exceed the threshold, Vertex will continue generating responses to the user's queries.