Skip to content

Commit 16383df

Browse files
✨ add support for rag param in workflow executions (#319)
1 parent 014834b commit 16383df

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

mindee/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def execute_workflow(
263263

264264
if not options:
265265
options = WorkflowOptions(
266-
alias=None, priority=None, full_text=False, public_url=None
266+
alias=None, priority=None, full_text=False, public_url=None, rag=False
267267
)
268268

269269
return self._send_to_workflow(GeneratedV1, input_source, workflow_id, options)

mindee/input/workflow_options.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ class WorkflowOptions:
1414
"""Whether to include the full OCR text response in compatible APIs."""
1515
public_url: Optional[str]
1616
"""A unique, encrypted URL for accessing the document validation interface without requiring authentication."""
17+
rag: bool
18+
"""Whether to enable Retrieval-Augmented Generation."""
1719

1820
def __init__(
1921
self,
2022
alias: Optional[str] = None,
2123
priority: Optional[ExecutionPriority] = None,
2224
full_text: Optional[bool] = False,
2325
public_url: Optional[str] = None,
26+
rag: Optional[bool] = False,
2427
):
2528
self.alias = alias
2629
self.priority = priority
2730
self.full_text = full_text if full_text else False
2831
self.public_url = public_url
32+
self.rag = rag if rag else False

mindee/mindee_http/workflow_endpoint.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def workflow_execution_post(
4545
params = {}
4646
if options.full_text:
4747
params["full_text_ocr"] = "true"
48+
if options.rag:
49+
params["rag"] = "true"
4850

4951
if isinstance(input_source, UrlInputSource):
5052
data["document"] = input_source.url

tests/workflows/test_workflow_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_workflow(mindee_client: Client, workflow_id: str, input_path: str):
3030
current_date_time = datetime.now().strftime("%Y-%m-%d-%H:%M:%S")
3131
alias = f"python-{current_date_time}"
3232
priority = ExecutionPriority.LOW
33-
options = WorkflowOptions(alias=alias, priority=priority)
33+
options = WorkflowOptions(alias=alias, priority=priority, rag=True)
3434

3535
response = mindee_client.execute_workflow(input_source, workflow_id, options)
3636

0 commit comments

Comments
 (0)