This commit adds a new guide file `loading_document.mdx` that provides an overview and example on how to load a document into a Prompt variable. The guide explains the process of defining a Prompt variable in the `PromptTemplate` component, connecting a `WebBaseLoader` to the variable, and building the flow. It also demonstrates how to chat with the document content in the context of a conversation. The commit also includes an embedded iframe that showcases the functionality described in the guide.
28 lines
1.1 KiB
Text
28 lines
1.1 KiB
Text
import ThemedImage from "@theme/ThemedImage";
|
|
import useBaseUrl from "@docusaurus/useBaseUrl";
|
|
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
|
import ReactPlayer from "react-player";
|
|
|
|
# Loading a document into a Prompt variable
|
|
|
|
## Overview
|
|
|
|
The following example shows how to load a document into a Prompt variable.
|
|
First, we define a Prompt variable in the PromptTemplate component,
|
|
then we connect a WebBaseLoader to that variable and build the flow.
|
|
|
|
Once the building is complete, we can start chatting having the content of the document in the context of the conversation.
|
|
|
|
<iframe
|
|
src="https://app.tango.us/app/embed/76578e84-a700-4b3b-a6ef-8a0350472781?iframe=true"
|
|
sandbox="allow-scripts allow-top-navigation-by-user-activation allow-popups allow-same-origin"
|
|
security="restricted"
|
|
title="Loading a document into a PromptTemplate variable"
|
|
width="100%"
|
|
height="800px"
|
|
referrerpolicy="strict-origin-when-cross-origin"
|
|
frameborder="0"
|
|
webkitallowfullscreen="webkitallowfullscreen"
|
|
mozallowfullscreen="mozallowfullscreen"
|
|
allowfullscreen="allowfullscreen"
|
|
></iframe>
|