VertexAI Chat
Audience:
Low-code EngineersSkill 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.
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.
Related Actions
| Action Name | Description |
|---|---|
| Chat | Chats with OpenAI or Microsoft Azure OpenAI models. |
| Aws AI Chat | Chats with models on Amazon Bedrock. |
| Summarize Content | Summarizes long content with OpenAI. |
| Create Articles | Writes articles with OpenAI. |
| Count Tokens | Counts the tokens in a text for an OpenAI model. |
| Speech to Text (Whisper) | Turns an audio file into text with OpenAI. |
| Add Connector | Creates a connector, for example a Google VertexAI connector. |
| Test Connector | Checks that a connector's details work. |
Comparing the chat actions
| Chat | Aws AI Chat | VertexAI Chat | |
|---|---|---|---|
| Provider | OpenAI or Microsoft Azure OpenAI | Amazon Bedrock | Google Vertex AI |
| Connector type | OpenAI (openAi) or Microsoft Azure OpenAI (azure.openAi) | Amazon Bedrock AI (plantanapp.aws.bedrock) | Google VertexAI (vertexAi) |
| Models | OpenAI: picked from PAA's model list. Azure: your deployment. | Claude, Llama or Titan, in fixed versions | Gemini and older PaLM models from PAA's list, or any model ID with an expression |
| Temperature and maximum length | Yes | No, fixed per model | Yes |
| JSON or JSON Schema reply | Yes | No | No |
| Workflows as tools | Yes | Claude and Llama only | No |
| Streaming | Optional | Optional | Required for Gemini, not possible for PaLM |
| Ignore Errors and On Error | Yes | No | Yes |
Connecting to Vertex AI
Create a connector first, in the Connectors area or with Add Connector. See Connectors.
| Connector type | Field | Description |
|---|---|---|
Google VertexAI (vertexAi) | Project Id | The ID of your Google Cloud project. |
Google VertexAI (vertexAi) | Location Id | The Google Cloud region to call, for example us-central1. PAA calls https://<Location Id>-aiplatform.googleapis.com. |
Google VertexAI (vertexAi) | Service Account JSON | The 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
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| VertexAI Connector | The Google VertexAI connector. You can also switch to an expression and use a token that holds the connector ID. | Yes | empty | Yes |
| Model | The model, for example gemini-pro. Pick it from the list, or switch to an expression and enter any Vertex AI model ID. See Models. | Yes | empty string | Yes |
| Stream Response | Streams the reply while it's being written. Must be on for Gemini models, and off for PaLM models. See Streaming. | No | false | No |
| Live Stream Name | The name of the live stream. It must be unique across the site. Shown when Stream Response is on. | Yes | empty string | With streaming |
| Message Stream ID | The ID of this message in the live stream. It must be unique within the live stream. Shown when Stream Response is on. | Yes | empty string | With streaming |
| Instructions | Tells the model how to behave, for example You are a helpful support assistant for [CompanyName]. | Yes | empty string | No |
| Previous Messages | The earlier messages of the conversation, as JSON. The format depends on the model. See Messages and history. | Yes | empty string | No |
| Message | The new user message, for example [Question]. | Yes | empty string | Yes |
| Temperature | How random the reply is, from 0 to 1. Lower values give more focused and repeatable answers. If empty, 0.2 is used. | No | 0.2 | No |
| Maximum Length | The maximum number of tokens the model may write in its reply. If the limit is reached, the reply is cut off. | No | 1024 | No |
| Ignore Errors | If on, an error doesn't stop the actions that follow. The error is written to the site's event log. On Error still runs. | No | false | No |
| On Error | Actions to run when the call fails. They can use [ErrorMessage], [ErrorCode] and [ErrorJson]. See Errors. | No | empty | No |
Output Parameters Reference
| Parameter | Description |
|---|---|
| Store Output Message | The token that gets the model's reply as text. |
| Store Entire Conversation JSON | The token that gets the whole conversation as JSON, including the new message and the reply. See Messages and history. |
| Store Entire Output | The 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:
| Model | Stream Response | Otherwise the action fails with |
|---|---|---|
Starts with gemini | On | The model ... can be used only with streaming. |
| Anything else (PaLM) | Off | The 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?" }
]
usermessages 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 JSONreturns the same shape, withRoleandContentkeys. 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:
- Use the same
Live Stream NameandMessage Stream IDin the Conversation View. - Add a
Statuscolumn in the Conversation View settings. It can beprocessing,doneorerror(not case-sensitive), or0,1or2. - Set the status to
processingbefore the chat action runs. Set it todoneorerrorafter 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:
| Token | Value |
|---|---|
[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 Erroraction stops execution, that result is used. - Otherwise, if
Ignore Errorsis off, the action fails with the error. - If
Ignore Errorsis 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 Messagesby hand, a quote or line break in a token value breaks the JSON. With Gemini, prefer passing backStore Entire Conversation JSONunchanged. - 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
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