Skip to content

Commit d6eecc0

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

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
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)

tests/test_code_samples.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ACCOUNT=$1
66
ENDPOINT=$2
77
API_KEY=$3
88

9-
for f in $(find ./docs/extras/code_samples -maxdepth 1 -name "*.txt" -not -name "workflow_execution.txt" | sort -h)
9+
for f in $(find ./docs/extras/code_samples -maxdepth 1 -name "*.txt" -not -name "workflow_*.txt" | sort -h)
1010
do
1111
echo
1212
echo "###############################################"

0 commit comments

Comments
 (0)