Skip to content

Commit 2f2518c

Browse files
✨ add support for rag param in workflow executions (#235)
1 parent f6a1844 commit 2f2518c

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/main/java/com/mindee/WorkflowOptions.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,23 @@ public class WorkflowOptions {
3232
*/
3333
String publicUrl;
3434

35+
/**
36+
* Whether to enable Retrieval-Augmented generation.
37+
*/
38+
Boolean rag;
39+
3540
@Builder
3641
private WorkflowOptions(
3742
String alias,
3843
ExecutionPriority priority,
3944
Boolean fullText,
40-
String publicUrl
45+
String publicUrl,
46+
Boolean rag
4147
) {
4248
this.alias = alias;
4349
this.priority = priority;
4450
this.fullText = fullText == null ? Boolean.FALSE : fullText;
4551
this.publicUrl = publicUrl;
52+
this.rag = rag;
4653
}
4754
}

src/main/java/com/mindee/http/MindeeHttpApi.java

+3
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,9 @@ private List<NameValuePair> buildPostParams(
388388
if (Boolean.TRUE.equals(requestParameters.getPredictOptions().getFullText())) {
389389
params.add(new BasicNameValuePair("full_text_ocr", "true"));
390390
}
391+
if (Boolean.TRUE.equals(requestParameters.getWorkflowOptions().getRag())) {
392+
params.add(new BasicNameValuePair("rag", "true"));
393+
}
391394
return params;
392395
}
393396

src/test/java/com/mindee/workflow/WorkflowIT.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected Execution<GeneratedV1> getFinancialDocumentWorkflow(String workflowId)
3535
IOException, MindeeException {
3636

3737
WorkflowOptions options = WorkflowOptions.builder().alias("java-" + currentDateTime).priority(
38-
ExecutionPriority.LOW).build();
38+
ExecutionPriority.LOW).rag(true).build();
3939
WorkflowResponse<GeneratedV1> response =
4040
client.executeWorkflow(workflowId, financialDocumentInputSource, options);
4141
return response.getExecution();

0 commit comments

Comments
 (0)