Generate prompt and text response with Google GenAI

This example pipeline demonstrates how to generate a prompt and subsequent text response using Google GenAI.

  1. Configure the JSON Generator Snap to pass your input data.
    Note: In this example, we use the JSON Generator Snap. However, you can replace the JSON Generator Snap with any Snap of your choice, such as the Chunker, Constant, File Reader, or S3 File Reader Snaps.

    JSON Generator Snap - Edit JSON

  2. Configure the Google GenAI Prompt Generator Snap to generate a user prompt as specified in the prompt template. In this example, the prompt template includes placeholders for an occupation and a situation.
    On validation, the Snap replaces the placeholders with actual values, and displays the generated prompt.
    Google GenAI Prompt Generator Snap configurations Google GenAI Prompt Generator Snap - Edit prompt Google GenAI Prompt Generator Snap output

    Google GenAI Prompt Generator Snap configurations


    Google GenAI Prompt Generator Snap - Edit prompt


    Google GenAI Prompt Generator Snap output

  3. Configure the Google Gemini Generate Snap to generate text response based on the model, prompt, model parameters and advanced prompt confugurations.
    The settings in this Snap enable you to refine the text response; this ensures that the generated text aligns with your conversational style and tone.

    On validation, the Snap displays the generated text response along with usage details.

    Google Gemini Generate Snap configuration Google Gemini Generate Snap output

    Google Gemini Generate Snap configuration


    Google Gemini Generate Snap output

To successfully reuse pipelines:
  1. Download and import the pipeline into the SnapLogic Platform.
  2. Configure Snap accounts, as applicable.
  3. Provide pipeline parameters, as applicable.