docs: add financial report parser to example flows (#8074)
* add-financial-report-parser-example * code-review-changes * table
This commit is contained in:
parent
8e58755849
commit
67cacf8a14
3 changed files with 58 additions and 0 deletions
57
docs/docs/Sample-Flows/financial-report-parser.md
Normal file
57
docs/docs/Sample-Flows/financial-report-parser.md
Normal file
|
|
@ -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.
|
||||
|
||||

|
||||
|
||||
## 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 <Icon name="Scan" aria-hidden="true"/> **Scan** icon in the **Template** field.
|
||||
The **Parser** component converts the extracted data into formatted messages for chat consumption.
|
||||
Each variable receives its value from the structured outputs.
|
||||
```text
|
||||
EBITDA: {EBITDA} , Net Income: {NET_INCOME} , GROSS_PROFIT: {GROSS_PROFIT}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
@ -25,6 +25,7 @@ module.exports = {
|
|||
'Sample-Flows/blog-writer',
|
||||
'Sample-Flows/document-qa',
|
||||
'Sample-Flows/memory-chatbot',
|
||||
'Sample-Flows/financial-report-parser',
|
||||
'Sample-Flows/sequential-agent',
|
||||
'Sample-Flows/travel-planning-agent',
|
||||
],
|
||||
|
|
|
|||
BIN
docs/static/img/starter-flow-financial-report-parser.png
vendored
Normal file
BIN
docs/static/img/starter-flow-financial-report-parser.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1,023 KiB |
Loading…
Add table
Add a link
Reference in a new issue