Skip to content

Commit 8985829

Browse files
committed
📝 add sample code for workflow RAG
1 parent 5e96665 commit 8985829

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# Install the Python client library by running:
3+
# pip install mindee
4+
#
5+
6+
from mindee import Client, product, AsyncPredictResponse
7+
8+
# Init a new client
9+
mindee_client = Client(api_key="my-api-key")
10+
11+
# Load a file from disk
12+
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")
13+
14+
# Load a file from disk and enqueue it.
15+
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
16+
product.FinancialDocumentV1,
17+
input_doc,
18+
# Set the workflow ID
19+
workflow_id="workflow-id",
20+
# Enable RAG on the workflow
21+
rag=True,
22+
)
23+
24+
# Print a brief summary of the parsed data
25+
print(result.document)

0 commit comments

Comments
 (0)