diff --git a/docs/docs/Tutorials/chat-with-files.md b/docs/docs/Tutorials/chat-with-files.md new file mode 100644 index 000000000..5e1b13a3d --- /dev/null +++ b/docs/docs/Tutorials/chat-with-files.md @@ -0,0 +1,209 @@ +--- +title: Create a chatbot that can ingest files +slug: /chat-with-files +--- + +import Icon from "@site/src/components/icon"; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +This tutorial shows you how to build a chatbot that can read and answer questions about files you upload, such as meeting notes or job applications. + +For example, you could upload a contract and ask, “What are the termination clauses in this agreement?” Or upload a resume and ask, “Does this candidate have experience with marketing analytics?” + +The main focus of this tutorial is to show you how to provide files as input to a Langflow flow, so your chatbot can use the content of those files in its responses. + +## Prerequisites + +- [A running Langflow instance](/get-started-installation) +- [A Langflow API key](/configuration-api-keys) +- [An OpenAI API key](https://platform.openai.com/api-keys) + + This tutorial uses an OpenAI LLM. If you want to use a different provider, you need a valid credential for that provider. + +## Create a flow that accepts file input + +To ingest files, your flow must have a **File** component attached to a component that receives input, such as a **Prompt** or **Agent** component. + +The following steps modify the [**Basic prompting**](/basic-prompting) template to accept file input: + +1. In Langflow, click **New Flow**, and then select the **Basic prompting** template. +2. In the **Language Model** component, enter your OpenAI API key. + + If you want to use a different provider or model, edit the **Model Provider**, **Model Name**, and **API Key** fields accordingly. +3. To verify that your API key is valid, click