From ec17b4e9d32d722fe00d7ff6725a8562560595a2 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 31 Jul 2023 14:51:09 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs(flow-runner.mdx):=20update?= =?UTF-8?q?=20explanation=20of=20using=20Document=20input=20in=20FlowRunne?= =?UTF-8?q?r=20class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The change clarifies that using a `Document` as input in the `FlowRunner` class is a straightforward way to pass text data in Langflow, specifically because it can be connected to many loaders. It also mentions that generally, a flow expects a string or a dictionary as input. Additionally, it updates the explanation of extracting the content of a document using the `page_content` attribute, which is a string. --- docs/docs/examples/flow-runner.mdx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/docs/examples/flow-runner.mdx b/docs/docs/examples/flow-runner.mdx index c4a8f8220..bcf2b9dd1 100644 --- a/docs/docs/examples/flow-runner.mdx +++ b/docs/docs/examples/flow-runner.mdx @@ -280,12 +280,11 @@ class FlowRunner(CustomComponent): return Document(page_content=str(result)) ``` -We are using a _`Document`_ as input because it is a straightforward way to pass text data in Langflow. +We are using a _`Document`_ as input because it is a straightforward way to pass text data in Langflow (specifically because you can connect it to many [loaders](../components/loaders)). Generally, a flow will take a string or a dictionary as input because that's what LangChain components expect. In case you are passing a dictionary, you need to build it according to the needs of the flow you are using. -The content of a document can be extracted using the _`page_content`_ property and passed as an argument to the selected flow. In this example, we are using a Document because it can be parsed by a [Loader](../components/loaders), but -we'd need to process _`page_content`_ depending on the input of the flow we are running. +The content of a document can be extracted using the _`page_content`_ attribute, which is a string, and passed as an argument to the selected flow. ---