From 67cacf8a14038558be06e14309fb983ecf0c4627 Mon Sep 17 00:00:00 2001 From: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Date: Tue, 20 May 2025 11:49:21 -0400 Subject: [PATCH] docs: add financial report parser to example flows (#8074) * add-financial-report-parser-example * code-review-changes * table --- .../Sample-Flows/financial-report-parser.md | 57 ++++++++++++++++++ docs/sidebars.js | 1 + .../starter-flow-financial-report-parser.png | Bin 0 -> 1047281 bytes 3 files changed, 58 insertions(+) create mode 100644 docs/docs/Sample-Flows/financial-report-parser.md create mode 100644 docs/static/img/starter-flow-financial-report-parser.png diff --git a/docs/docs/Sample-Flows/financial-report-parser.md b/docs/docs/Sample-Flows/financial-report-parser.md new file mode 100644 index 000000000..980e33ff7 --- /dev/null +++ b/docs/docs/Sample-Flows/financial-report-parser.md @@ -0,0 +1,57 @@ +--- +title: Financial report parser +slug: /financial-report-parser +--- + +import Icon from "@site/src/components/icon"; + +Build a **Financial Report Parser** flow with the [Structured output](/components-helpers#structured-output) and [Parser](/components-processing#parser) components to parse LLM responses into a structured format. + +In this example, the **Chat Input** component is pre-loaded with a sample financial report to demonstrate extracting `Gross Profit`, `EBITDA`, and `Net Income`. + +## Prerequisites + +- [A running Langflow instance](/get-started-installation) +- [An OpenAI API key](https://platform.openai.com/) + +## Create the financial report parser flow + +1. From the Langflow dashboard, click **New Flow**. +2. Select **Financial Report Parser**. + +The **Financial Report Parser** flow is created. + +![](/img/starter-flow-financial-report-parser.png) + +## Run the memory chatbot flow + +1. Add your OpenAI API key to the OpenAI model. +2. Click the **Playground** button, and then click **Send**. +The **Chat Input** component is pre-loaded with a sample financial report for demonstration purposes. +The chat returns a structured response: + +```text +EBITDA: $900 million , Net Income: $500 million , GROSS_PROFIT: $1.2 billion +``` + +Inspect the flow to understand how this information was extracted. + +3. To inspect the output schema table, in the **Structured Output** component, click **Open table**. +The **Structured Output** component uses the attached **OpenAI** model component as its "brain" to extract financial data into a [DataFrame](/concepts-objects#dataframe-object) with this defined schema. +```text +| Name | Description | Type | Multiple | +|--------------|-----------------------|------|----------| +| EBITDA | description of field | text | False | +| NET_INCOME | description of field | text | False | +| GROSS_PROFIT | description of field | text | False | +``` + +4. To inspect the template that contains the extracted data, in the **Parser** component, click the