Google GenAI Prompt Generator

Overview

You can use this Snap to generate the user prompt as specified in the prompt template using the mustache template.


Google GenAI Prompt Generator Overview

Prerequisites

None.

Limitations and known issues

None.

Snap views

View Description Examples of upstream and downstream Snaps
Input This Snap has at the most one document output view. The Snap requires a prompt template. Mapper
Output This Snap supports at the most one binary or document input view. The Snap provides the augmented user prompt which is the combination of the user prompt and relevant context in the prompt template. Mapper
Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution Stops the current pipeline execution when an error occurs.
  • Discard Error Data and Continue Ignores the error, discards that record, and continues with the remaining records.
  • Route Error Data to Error View Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap settings

Note:
  • Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.
  • Expression icon (): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
  • Add icon (Plus Icon): Indicates that you can add fields in the field set.
  • Remove icon (Minus Icon): Indicates that you can remove fields from the field set.
Field / Field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: Google GenAI Prompt Generator

Example: Generate customer support prompt
Prompt template Dropdown list
Select the template to build the final prompt. The available option is Context Q & A. This Snap supports variable replacement through a mustache on the input document.
Note: To reset the Prompt template to the default settings, click the Edit prompt and then click Generate Template.

Default value: Context Q & A

Edit prompt Button

In the Edit prompt window, configure the prompt details to generate a user prompt.

Advanced prompt output Checkbox

Select this checkbox to output the entire prompt content array instead of the individual prompt content.

Default status: Deselected

User role Dropdown list/Expression

Appears when you select the Advanced prompt output checkbox.

Required. Choose the role to use for the prompt. Available options include:
  • USER: Simulates prompt as if they are initiated by a user interacting with the system.
  • MODEL: Simulates the prompt as if it were generated by the system or model itself.

Default value: USER

Example: MODEL
Content String/Expression

Appears when you select Advanced prompt output checkbox and USER in the User role field.

Specify the multimodal content to be used in the prompt.

Default value: N/A

Example: $content
Snap execution Dropdown list
Select one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Validate & Execute

Example: Execute only

Examples