Skip to content

Vertex AI

Element Name: Vertex AI

Category: Cognitive

Description: Vertex AI provides access to Gemini, a multimodal model from Google DeepMind capable of understanding virtually any input, combining different types of information, and generating almost any result.

Functionality: Extension module that allows generating responses based on Google's generative AI and simultaneously evaluates cognitively on the default cognitive engine in the tenant.

Prerequisite:

  • Have an account on Vertex AI.
  • Create a Google service account for model integration with Lynn.
  • Have a previously established cognitive context in the Lynn application.

Action Configuration Fields Sentiment Analysis (Required)

[Name]: Unique descriptor for configuration box identification purposes.

[Random dialog type action to continue the conversation]: Dropdown list containing the dialogues created in the Lynn application.

[Expression defining the training prompt]: Text input to generate a model response. Instructions may include predicates, questions, suggestions, instructions, or examples.

[LOCATION_ID]: Parameter where the Location ID name must be entered.

[PUBLISHER]: Parameter where the publisher name must be entered.

[MODEL]: Parameter where the model name must be entered.

[TEMPERATURE]: Field where the temperature is entered for samples during response generation when applying topP and topK. It controls the degree of randomness in token selection. Lower temperatures are suitable for messages requiring a less open or creative response, while higher temperatures can generate more diverse or creative results.

[MAX OUTPUT TOKENS]: This field determines the maximum number of tokens in the text output. A lower value will generate shorter responses, while a higher value will produce longer responses.

[TOP P]: P top changes how the model selects tokens for output. Tokens are selected from the top K (see topK parameter) until it is lower until the sum of their probabilities equals the top P value.

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, then the model will select A or B as the next token (with temperature) and will not consider C. The default value of top P is 0.95.

[TOP K]: Top K changes how the model selects tokens for output. For example, a top K of 1 means the selected token is the most probable among all tokens in the model's vocabulary (also called greedy decoding), while a top K of 3 means the next token is selected from the 3 most probable tokens (using temperature).

Note: For more information on these fields, you can visit the following link https://cloud.google.com/vertex-ai/docs/generative-ai/start/quickstarts/api-quickstart?hl=en

[Certainty (1-100) with which the intention is identified]: Field allowing entry of a percentage of acceptance.

[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 with the name: 'vertexAi_Error']: Dropdown box displaying a list of intentions where you must select the one that will be activated in case of an error.

Google Service Account VetexAI (Required)

[PROJECT ID]: Parameter corresponding to the Google Service Account configuration.

[PRIVATE KEY ID]: Parameter corresponding to the Google Service Account configuration.

[PRIVATE KEY]: Parameter corresponding to the Google Service Account configuration.

[CLIENT EMAIL]: Parameter corresponding to the Google Service Account configuration.

[CLIENT_ID]: Parameter corresponding to the Google Service Account configuration.

Implementation Example:

The following example describes the required configuration to generate responses based on Google's AI.

--Input:

[Name]: TestVertex

[Random dialog type action to continue the conversation]: d_vertex

[Expression defining the training prompt]: 'answer the following questions based on the page https://resources.lynn.cx/'

[LOCATION_ID]: us-central1

[PUBLISHER]: google

[MODEL]: text-bison@001

[TEMPERATURE]: 0.2

[MAX OUTPUT TOKENS]: 256

[TOP P]: 0.95

[TOP K]: 40

[Certainty (1-100) with which the intention is identified]: 70

[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 with the name: 'vertexAi_Error']: Error_Handler

Google Service Account VetexAI (Required)

[PROJECT ID]: test-vertex

[PRIVATE KEY ID]: xxxxxxxxxxxxxxxxxxxxx

[PRIVATE KEY]: xxxxxxxxxxxxxxxxxxxxx

[CLIENT EMAIL]: test@test-vertexxxxxxxxxxx

[CLIENT_ID]: 10751xxxxxxxxxxxxxxxx

-- Result:

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

The cognitive evaluation meets the conditions to execute the target intention.

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