Generate FAQ responses with Converse API

This example pipeline demonstrates how to generate a prompt and subsequent FAQ response using the Converse API.

  1. Configure the JSON Generator Snap to pass your input data:
    [
        {
            "prompt1": "A Snap in my pipeline is failing with a 'NullPointerException' error. What steps do I take to identify and resolve the issue?",
            "prompt2": "My pipeline is not processing records as expected, and the Snap logs show an 'Invalid Query' error. What steps can I take to diagnose and fix the query issue?"
        }
    ]
    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.
  2. Configure the Amazon Bedrock Prompt Generator Snap to generate a user prompt as specified in the prompt template that includes placeholders for a prompt1 and prompt2.
    The user is asking about SnapLogic's features. Provide a concise, helpful response. 
    Question: {{prompt1}} Answer:
    Question: {{prompt2}} Answer:
    On validation, the Snap replaces the placeholders with actual values, and displays the generated prompt.
    Amazon Bedrock Prompt Generator Snap Configuration Amazon Bedrock Prompt Generator Snap Output

    Amazon Bedrock Prompt Generator Snap Configuration


    Amazon Bedrock Prompt Generator Snap Output

  3. Configure the Amazon Bedrock Converse API Snapto generate responses to FAQ questions using the Model, Prompt, Model Parameters, and Advanced Prompt configurations.
    These settings allow you to fine-tune the message response, ensuring the generated text matches your desired conversational style and tone. In this example, the System prompt is set to: You are a SnapLogic Support Executive. Provide concise, accurate answers to SnapLogic product-related questions. to ensure the specified model assumes this role while generating the responses. The Stop sequences is set to: ["Thank you for your question.", "If you have any more questions, feel free to ask.", "<|endofresponse|>"] to ensure that the model stops generating text once it reaches this instruction, providing a precise and relevant response for each FAQ question.

    On validation, the Snap displays the generated FAQ responses to the two questions separately, with the usage details.

    Amazon Bedrock Converse API Snap Configuration Amazon Bedrock Converse API Snap Output

    Amazon Bedrock Converse API Snap Configuration


    Amazon Bedrock Converse API Snap Output

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