Generate prompt and chat response with Azure OpenAI

This example pipeline demonstrates how to generate a prompt and subsequent chat response using Azure OpenAI.

  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.

    Azure OpenAI Example Pipeline

  2. Configure the Azure OpenAI Prompt Generator Snap to generate a user prompt as specified in the prompt template. In this example, the prompt template includes placeholders for a role and an introductory statement.
    On validation, the Snap replaces the placeholders with actual values, and displays the generated prompt.
    Azure OpenAI Prompt Generator Snap - Edit prompt Azure OpenAI Prompt Generator Snap Output

    Azure OpenAI Prompt Generator Snap - Edit prompt


    Azure OpenAI Prompt Generator Snap Output

  3. Configure the Azure OpenAI Chat Completions Snap to generate chat completions based on the Deployment ID, Prompt, and model parameters.
    The settings in this Snap enable you to refine the chat response; this ensures that the generated text aligns with your conversational style and tone.

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

    Azure OpenAI Chat Completions Snap Configuration Azure OpenAI Chat Completions Snap Output

    Azure OpenAI Chat Completions Snap Configuration


    Azure OpenAI Chat Completions Snap Output

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