Google Vertex AI
API actions for the Google Vertex AI integration.
Google Vertex AI
Use Google Vertex AI to generate, summarize, translate, and classify text, or create embeddings for smart search.
Send chat message
Send a chat message to a Vertex AI model and get a reply.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
messages | array | Yes | The chat messages to send, in order |
model | string | No | The model to use (default: gemini-1.5-flash) |
Response
{
"message_count": 1,
"response_text": "Hello! How can I help you today?"
}Classify text
Classify text into categories using a Vertex AI model.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to classify |
model | string | No | The model to use (default: gemini-1.5-flash) |
Response
{
"categories": [
{
"confidence": 0.95,
"name": "Technology"
},
{
"confidence": 0.72,
"name": "Business"
}
],
"model_used": "gemini-1.5-flash"
}Create text embedding
Turn text into an embedding — a list of numbers that apps use to search and compare text by meaning.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to turn into an embedding |
model | string | No | The embedding model to use (default: text-embedding-004) |
Response
{
"dimension": 5,
"embedding": [
0.1,
0.2,
0.3,
0.4,
0.5
]
}Generate text
Generate text using a Vertex AI language model.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | What you want the AI to write or answer |
model | string | No | The model to use (default: gemini-1.5-pro) |
temperature | number | No | How creative the response should be, from 0 (focused and predictable) to 2 (more varied). If left blank, 0.2 is used |
Response
{
"model_used": "gemini-1.5-pro",
"response_text": "This is a sample generated text response."
}Summarize text
Summarize a document using a Vertex AI model.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
document | string | Yes | The document text to summarize |
model | string | No | The model to use (default: gemini-1.5-pro) |
Response
{
"model_used": "gemini-1.5-pro",
"summary": "This is a concise summary of the document."
}Translate text
Translate text to a target language using a Vertex AI model.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to translate |
target_language | string | Yes | The language to translate into, given as a language code: for example, 'en' for English, 'es' for Spanish, or 'fr' for French |
model | string | No | The model to use (default: gemini-1.5-flash) |
Response
{
"model_used": "gemini-1.5-flash",
"translated_text": "Hola, como estas?"
}