Lodol Docs

Google Vertex AI

API actions for the Google Vertex AI integration.

Google Vertex AI

Use Google Vertex AI for text generation, embeddings, translation, and classification.


Chat message

Send a chat message to a Vertex AI conversational model.

Parameters

ParameterTypeRequiredDescription
messagesarrayYesList of message strings for the chat conversation
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"
}

Embed text

Generate text embeddings using a Vertex AI embedding model.

Parameters

ParameterTypeRequiredDescription
textstringYesThe text to embed
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
promptstringYesThe prompt text for generation
modelstringNoThe model to use (default: gemini-1.5-pro)
temperaturenumberNoSampling temperature between 0 and 2 (default: 0.2)

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 target language code (e.g., 'en', 'es', 'fr')
modelstringNoThe model to use (default: gemini-1.5-flash)

Response

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

On this page