Lodol Docs

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

ParameterTypeRequiredDescription
messagesarrayYesThe chat messages to send, in order
modelstringNoThe 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

ParameterTypeRequiredDescription
textstringYesThe text to classify
modelstringNoThe 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

ParameterTypeRequiredDescription
textstringYesThe text to turn into an embedding
modelstringNoThe 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

ParameterTypeRequiredDescription
promptstringYesWhat you want the AI to write or answer
modelstringNoThe model to use (default: gemini-1.5-pro)
temperaturenumberNoHow 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

ParameterTypeRequiredDescription
documentstringYesThe document text to summarize
modelstringNoThe 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

ParameterTypeRequiredDescription
textstringYesThe text to translate
target_languagestringYesThe language to translate into, given as a language code: for example, 'en' for English, 'es' for Spanish, or 'fr' for French
modelstringNoThe model to use (default: gemini-1.5-flash)

Response

{
  "model_used": "gemini-1.5-flash",
  "translated_text": "Hola, como estas?"
}

On this page