Summarize document and query information with OpenAI

This example pipeline demonstrates how to summarize a document and extract necessary information with OpenAI.

  1. Configure the File Reader Snap to pass your PDF file.
  2. Configure the PDF Parser Snap to parse the PDF file as an image. Set Parser type to Pages to image converter to enable the downstream Snap to process the document as an image.

    PDF Parser Snap configuration

  3. Configure the OpenAI Multimodal Content Generator Snap with the Type set to image and Content type with image/jpeg to retreive the image from the usptream Snap for multimodal content processing.

    On validation, the Snap outputs a structured response that includes sl_content (the actual content), sl_contentType (content format), and sl_type (indicating the modality).

    OpenAI Multimodal Content Generator Snap configuration OpenAI Multimodal Content Generator Snap output

    OpenAI Multimodal Content Generator Snap configuration


    OpenAI Multimodal Content Generator Snap output

  4. Configure the OpenAI Prompt Generator Snap with the upstream multimodal content and set the prompt to Summarize the uploaded document in 5 key points, and provide the count of nonfederal wildfires reported in 2018.

    On validation, the Snap displays the upstream multimodal content passed, including the prompt details.

    OpenAI Prompt Generator Snap configuration OpenAI Prompt Generator Snap output

    OpenAI Prompt Generator Snap configuration


    OpenAI Prompt Generator Snap output

  5. Configure the OpenAI Chat Completions Snap to process incoming multimodal content and generate the responses based on the prompt.

    On validation, the Snap displays the response with the summarized information, the answer to the specific query, and cites the source from the document.

    OpenAI Chat Completions Snap configuration OpenAI Chat Completions Snap output

    OpenAI Chat Completions Snap configuration


    OpenAI Chat Completions 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.