From a9a5c3490ccf85b8085899dca5781cd7b64cb36e Mon Sep 17 00:00:00 2001 From: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Date: Thu, 10 Jul 2025 12:55:40 -0400 Subject: [PATCH] docs: chatbot with files tutorial (#8813) * minimal-working-code * remove-old-files-and-add-new-content * cleanup * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * intro-and-sidebars * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * Apply suggestions from code review * add-fake-resume * docs: update chat-with-files tutorial to include Langflow API key and clarify file upload process * docs: enhance chat-with-files tutorial to support multiple file uploads with example code * move-file-and-fixpath * Apply suggestions from code review Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> * docs: update fake resume with new example details * Apply suggestions from code review --------- Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com> --- docs/docs/Tutorials/chat-with-files.md | 209 ++++++++++++++++++ docs/sidebars.js | 7 + docs/static/files/fake-resume.txt | 31 +++ docs/static/img/tutorial-chat-file-loader.png | Bin 0 -> 823084 bytes 4 files changed, 247 insertions(+) create mode 100644 docs/docs/Tutorials/chat-with-files.md create mode 100644 docs/static/files/fake-resume.txt create mode 100644 docs/static/img/tutorial-chat-file-loader.png 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