Skip to content

📝 add sample code for workflow RAG #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docs/extras/code_samples/workflow_ots_rag.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Install the Python client library by running:
# pip install mindee
#

from mindee import Client, product, AsyncPredictResponse

# Init a new client
mindee_client = Client(api_key="my-api-key")

# Load a file from disk
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")

# Load a file from disk and enqueue it.
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
product.FinancialDocumentV1,
input_doc,
# Set the workflow ID
workflow_id="workflow-id",
# Enable RAG on the workflow
rag=True,
)

# Print a brief summary of the parsed data
print(result.document)
2 changes: 1 addition & 1 deletion tests/test_code_samples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ACCOUNT=$1
ENDPOINT=$2
API_KEY=$3

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