Skip to main content
Version: 1.28 (Current)

VertexAI Chat

Audience: Low-code Engineers

Skill Prerequisites: Actions, Tokens, Connectors

Sends a message to a Google Vertex AI chat model and stores the reply in a token. You can give the model instructions, pass the earlier messages of a conversation, and set the temperature and maximum length.

The action works with Gemini models and with the older PaLM chat models (chat-bison, codechat-bison). The Google Cloud sign-in details come from a Google VertexAI connector.

note

This action is part of the PlantAnApp.OpenAi add-on. The add-on is installed separately and requires the AI feature package to be licensed. If it isn't licensed, the action fails with a not-licensed error. The Google VertexAI connector type needs the same license.

Typical Use Cases​

  • Answer users' questions with a Gemini model in your own Google Cloud project
  • Continue a conversation by passing the earlier messages back to the model
  • Stream the reply word by word to a Conversation View
  • Draft text, such as a reply to a customer, from details in tokens

Don't use it to​

  • Send data you aren't allowed to share with Google. Everything in the message, instructions and history leaves your server.
  • Make decisions that must always be correct, such as approvals or calculations. Check the reply, or use normal actions and SQL.
  • Get JSON replies with a schema, or let the model run workflows. Use Chat instead.
  • Send images or files. The action sends text only.
Action NameDescription
ChatChats with OpenAI or Microsoft Azure OpenAI models.
Aws AI ChatChats with models on Amazon Bedrock.
Summarize ContentSummarizes long content with OpenAI.
Create ArticlesWrites articles with OpenAI.
Count TokensCounts the tokens in a text for an OpenAI model.
Speech to Text (Whisper)Turns an audio file into text with OpenAI.
Add ConnectorCreates a connector, for example a Google VertexAI connector.
Test ConnectorChecks that a connector's details work.

Comparing the chat actions​

ChatAws AI ChatVertexAI Chat
ProviderOpenAI or Microsoft Azure OpenAIAmazon BedrockGoogle Vertex AI
Connector typeOpenAI (openAi) or Microsoft Azure OpenAI (azure.openAi)Amazon Bedrock AI (plantanapp.aws.bedrock)Google VertexAI (vertexAi)
ModelsOpenAI: picked from PAA's model list. Azure: your deployment.Claude, Llama or Titan, in fixed versionsGemini and older PaLM models from PAA's list, or any model ID with an expression
Temperature and maximum lengthYesNo, fixed per modelYes
JSON or JSON Schema replyYesNoNo
Workflows as toolsYesClaude and Llama onlyNo
StreamingOptionalOptionalRequired for Gemini, not possible for PaLM
Ignore Errors and On ErrorYesNoYes

Connecting to Vertex AI​

Create a connector first, in the Connectors area or with Add Connector. See Connectors.

Connector typeFieldDescription
Google VertexAI (vertexAi)Project IdThe ID of your Google Cloud project.
Google VertexAI (vertexAi)Location IdThe Google Cloud region to call, for example us-central1. PAA calls https://<Location Id>-aiplatform.googleapis.com.
Google VertexAI (vertexAi)Service Account JSONThe full JSON key file of a service account that may use Vertex AI in that project. PAA uses it to get an access token for each call.

Test Connector checks the connector by sending a short chat prompt to the chat-bison model.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
VertexAI ConnectorThe Google VertexAI connector. You can also switch to an expression and use a token that holds the connector ID.YesemptyYes
ModelThe model, for example gemini-pro. Pick it from the list, or switch to an expression and enter any Vertex AI model ID. See Models.Yesempty stringYes
Stream ResponseStreams the reply while it's being written. Must be on for Gemini models, and off for PaLM models. See Streaming.NofalseNo
Live Stream NameThe name of the live stream. It must be unique across the site. Shown when Stream Response is on.Yesempty stringWith streaming
Message Stream IDThe ID of this message in the live stream. It must be unique within the live stream. Shown when Stream Response is on.Yesempty stringWith streaming
InstructionsTells the model how to behave, for example You are a helpful support assistant for [CompanyName].Yesempty stringNo
Previous MessagesThe earlier messages of the conversation, as JSON. The format depends on the model. See Messages and history.Yesempty stringNo
MessageThe new user message, for example [Question].Yesempty stringYes
TemperatureHow random the reply is, from 0 to 1. Lower values give more focused and repeatable answers. If empty, 0.2 is used.No0.2No
Maximum LengthThe maximum number of tokens the model may write in its reply. If the limit is reached, the reply is cut off.No1024No
Ignore ErrorsIf on, an error doesn't stop the actions that follow. The error is written to the site's event log. On Error still runs.NofalseNo
On ErrorActions to run when the call fails. They can use [ErrorMessage], [ErrorCode] and [ErrorJson]. See Errors.NoemptyNo

Output Parameters Reference​

ParameterDescription
Store Output MessageThe token that gets the model's reply as text.
Store Entire Conversation JSONThe token that gets the whole conversation as JSON, including the new message and the reply. See Messages and history.
Store Entire OutputThe token that gets Google's full JSON response. Filled only for PaLM models. With Gemini (streaming), it stays empty.

Models​

The Model list comes from PAA's AI model table. In 1.28 it has:

  • Gemini: gemini-pro, gemini-1.0-pro-001, gemini-1.0-pro-002, gemini-1.5-pro-preview-0409, gemini-1.5-pro-preview-0514, gemini-1.5-flash-preview-0514
  • PaLM: chat-bison, chat-bison@001, chat-bison@002, chat-bison-32k, chat-bison-32k@002, codechat-bison, codechat-bison@001, codechat-bison@002, codechat-bison-32k, codechat-bison-32k@002

Google retires older models over time, and many of these may no longer be available in your project. To use a newer model, switch Model to an expression and enter its model ID from Google's documentation.

PAA treats every model ID that starts with gemini as a Gemini model. Gemini models must run with Stream Response on. Other models must run with it off:

ModelStream ResponseOtherwise the action fails with
Starts with geminiOnThe model ... can be used only with streaming.
Anything else (PaLM)OffThe model ... does not support streaming.

Other settings are fixed: PAA asks for one reply, with top-P 0.8 and top-K 40.

Messages and history​

Instructions go to Gemini as its system instruction, and to PaLM as the conversation context. The Message is added as the last user message.

The format of Previous Messages depends on the model.

Gemini uses a JSON array of role and content pairs:

[
{ "role": "user", "content": "Hi, my printer won't print." },
{ "role": "assistant", "content": "Sorry to hear that. Is it showing an error light?" }
]
  • user messages are sent as the user. Any other role is sent as the model.
  • User messages at the end of the history are dropped, so the history always ends with a model reply before the new Message.
  • Store Entire Conversation JSON returns the same shape, with Role and Content keys. You can pass it back unchanged next time.

PaLM models use the Vertex AI chat request format, with author and content:

{
"instances": [
{
"messages": [
{ "author": "user", "content": "Hi, my printer won't print." },
{ "author": "assistant", "content": "Sorry to hear that. Is it showing an error light?" }
]
}
]
}

For PaLM, Store Entire Conversation JSON returns a different shape, so you can't pass it back unchanged in 1.28.

If Previous Messages doesn't match the expected format, the action fails with The Previous Messages parameter is not valid JSON.

Streaming​

With Stream Response on, the reply is sent to a live stream while the model writes it. The action still waits for the full reply and stores it in Store Output Message.

Gemini models need Stream Response on, even when no Conversation View shows the reply. Fill in a Live Stream Name and a Message Stream ID anyway.

To show the reply in a Conversation View:

  1. Use the same Live Stream Name and Message Stream ID in the Conversation View.
  2. Add a Status column in the Conversation View settings. It can be processing, done or error (not case-sensitive), or 0, 1 or 2.
  3. Set the status to processing before the chat action runs. Set it to done or error after it.

Errors​

When the call fails, for example because of a wrong service account, a model that isn't available or the wrong Stream Response setting, On Error runs with these tokens:

TokenValue
[ErrorMessage]The error message, from Google when there is one.
[ErrorCode]The HTTP status code from Google, for example 403. Empty for errors inside PAA.
[ErrorJson]Google's error response as JSON. Empty for errors inside PAA.

After On Error:

  • If an On Error action stops execution, that result is used.
  • Otherwise, if Ignore Errors is off, the action fails with the error.
  • If Ignore Errors is on, the error is logged and the next action runs.

Retries and timeouts:

  • With Gemini, if Google answers Too Many Requests, PAA waits 20 seconds and tries again. It keeps trying until the call succeeds or fails with another error. PaLM calls aren't retried.
  • Each request times out after 5 minutes. A timed-out Gemini request is sent again.

Considerations​

  • Data privacy. The instructions, history and message are sent to Google Vertex AI in your project. Check that your data rules allow it.
  • Cost. Google bills your project for every token sent and received. Long histories add up.
  • Replies can be wrong. Check important answers before you act on them.
  • Service account. Give the service account only the Vertex AI permissions it needs, and keep its JSON key in the connector only.
  • Building JSON with tokens. Token values aren't escaped when they're placed in JSON. If you build Previous Messages by hand, a quote or line break in a token value breaks the JSON. With Gemini, prefer passing back Store Entire Conversation JSON unchanged.
  • No usage records or debug payloads. Unlike Chat, this action doesn't save PAA usage records or return the raw requests.
  • Conditions. In the action's Condition, token values are placed in quotes, for example [Question] != "". See Common Parameters.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

Replace the connector ID 00000000-0000-0000-0000-000000000000 with the ID of your own connector, or select the connector after you import the action. Replace the model ID with one that's available in your Google Cloud project.

1. Answer a question with Gemini in a workflow​

This action sends the user's question to a Gemini model and stores the answer in Answer. Gemini needs streaming, so the stream fields are filled in even though no Conversation View is used. It runs only when Question has a value.

{
"Title": "VertexAI Chat",
"ActionType": "VertexAi.Chat",
"Description": "Answer the question with Gemini",
"Condition": "[Question] != \"\"",
"Parameters": {
"VertexAiConnector": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"Model": "gemini-pro",
"StreamResponse": true,
"LiveStreamName": "support-answers",
"MessageStreamId": "[RequestId]",
"Instructions": "You are a helpful support assistant for [CompanyName]. Answer in one short paragraph.",
"Message": "[Question]",
"Temperature": 0.2,
"MaxTokens": 400,
"StoreMessage": "Answer"
}
}

2. Continue a conversation in a Conversation View​

This action streams the reply to a Conversation View, passes the stored conversation back as history, and saves the updated conversation in the same token. If the call fails, the error is logged.

{
"Title": "VertexAI Chat",
"ActionType": "VertexAi.Chat",
"Description": "Reply in the ongoing conversation",
"Parameters": {
"VertexAiConnector": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"Model": "gemini-pro",
"StreamResponse": true,
"LiveStreamName": "booking-chat",
"MessageStreamId": "[MessageId]",
"Instructions": "You are a friendly assistant for our booking site.",
"PreviousMessageJson": "[ConversationJson]",
"Message": "[UserMessage]",
"StoreMessage": "Answer",
"StoreEntireConversationJson": "ConversationJson",
"OnError": [
{
"Title": "Log Error",
"ActionType": "LogError",
"Parameters": {
"Message": "VertexAI Chat failed ([ErrorCode]): [ErrorMessage]"
}
}
]
}
}

Revised 09/27/2026