Semarchy GenAI Gemini enricher

The Semarchy GenAI Gemini enricher generates a single text response based on a user prompt.

Plugin ID

Semarchy GenAI Gemini Enricher - com.semarchy.engine.plugins.genai.gemini.simple

Description

The GenAI Gemini enricher is designed to enhance text data using Google Gemini language models. Users can leverage this enricher to improve the quality, relevance, and depth of their text data using advanced AI capabilities.

Prerequisites

To authenticate with the Vertex AI API, you need to have a Google Cloud service account and must configure xDM to integrate Gemini models.

  1. Create a Google Cloud service account.
    For detailed information, see the official Vertex AI documentation.

  2. At the end of the account creation process, download the service account key file.

  3. In xDM’s startup configuration, set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the service account key file that contains your credentials.

For additional information on how to get started with Vertex AI, see the LangChain4j documentation.

Plugin parameters

The following table lists the plugin parameters.

Parameter name Mandatory Type Description

Project

Yes

String

A globally unique, permanent identifier generated by the Google Cloud console. The project ID can be a combination of lowercase letters, numbers, and hyphens.

While it is possible to modify the project ID during project creation, we recommend using the one generated by the Google Cloud console.

Location

Yes

String

Geographical region where the Gemini model will be deployed and used. The following regions are supported:

  • Iowa (us-central1)

  • Las Vegas, Nevada (us-west4)

  • Montréal, Canada (northamerica-northeast1)

  • Northern Virginia (us-east4)

  • Oregon (us-west1)

  • Seoul, Korea (asia-northeast3)

  • Singapore (asia-southeast1)

  • Tokyo, Japan (asia-northeast1)

Model Name

Yes

String

Language model to be used.

To use the latest version, enter the model name without a version number, such as gemini-1.0-pro, gemini-1.5-pro, or gemini-1.5-flash.

Temperature

No

Number

Value ranging from 0.0 to 1.0 for balancing between conservative and coherent outputs (0) and creative variations (1) during text generation.

Max Output Tokens

No

Integer

Maximum number of tokens allowed in the generated output during text generation.
Default value: 50

A token is about four characters, with 100 tokens equaling roughly 60-80 words. For shorter responses, specify a lower token value; for longer responses, specify a higher value. For reference, the Gemini Pro range is 1-8192 tokens (default: 8192), and the Gemini Pro Vision range is 1-2048 tokens (default: 2048).

Top K

No

Number

Value ranging from 1 to 40 for limiting the model’s predictions to the most probable tokens at each step of generation.

Top P

No

Number

Value ranging from 0.0 to 1.0 for defining the cumulative probability threshold for nucleus sampling (i.e., token selection).

Nucleus sampling is an alternative to temperature sampling. Ignore this parameter if you configured the Temperature parameter.

Max Retries

No

Integer

Maximum number of attempts allowed for API requests before considering them unsuccessful.
Default value: 3

Language models

Language models are AI systems trained on vast amounts of text data to understand and generate human-like language, enabling tasks like text completion, translation, summarization, and sentiment analysis.

The Vertex AI API offers a range of models with distinct capabilities. For more information on Gemini models and a list of stable model versions, see the official Vertex AI documentation.

Tokens

Tokens are units of text that language models use to process and generate language. They can range from individual characters to entire words, depending on the language and the specific model being used.

For more information about tokens, see the official Vertex AI documentation.

Plugin inputs

The following table lists the plugin inputs.

Input name Mandatory Type Description

User Prompt

Yes

String

Input query specifying the user’s particular needs, intentions, or requests for the generated text.

Plugin outputs

The following table lists the plugin outputs.

Output name Type Description

Response

String

Generated response applied to a designated attribute.

Examples and use cases

Social media blurb generation: summarizing product descriptions

Imagine a scenario where a user needs a condensed version of a detailed product description for social media, where character or space limits apply. In practice, during record creation or editing, the user wants a brief social media blurb to be generated based on the Description field’s content.

For instance, consider the Velocity Pro Carbon Bike product record with the following description:
"Introducing the Velocity Pro Carbon Bike from Italy, a high-performance masterpiece meticulously crafted for speed enthusiasts. This aerodynamic marvel boasts cutting-edge design and lightweight materials, providing an unparalleled riding experience. Elevate your cycling adventures with the pinnacle of Italian engineering. Price: 134."

Suppose the enricher is configured as follows:

  • In the plugin input properties:

    • User Prompt: 'Summarize the following description in less than 150 characters: ' || Description

  • In the plugin output properties:

    • Attribute Name: SocialMediaBlurb

In this setup, the response provided by the enricher will populate the Social Media Blurb field of the Velocity Pro Carbon Bike record with the following:
"Introducing the Velocity Pro Carbon Bike from Italy: a high-performance marvel, aerodynamic design, lightweight materials, ultimate riding experience. Price: $134."

Additional use cases

Below are just a few examples of the diverse range of use cases that the GenAI OpenAI enricher can support:

  • Content generation: create detailed descriptions of products or customer personas; generate captions for social media posts, ads, or campaigns.

  • Content synthesis: capture the essence of a text to create titles or names for products, services, or features.

  • Content quality: enhance clarity, refine structure, and adjust tone to meet specific communication goals; correct spelling and grammar errors to adhere to standard language conventions.

  • Custom tone of voice: adapt the tone of the text to align with specific communication objectives, conveying neutrality, professionalism, empathy, education, or casualness.

  • Language translation: translate text into one or several other languages.

  • Price conversion: convert product prices from one currency to another.