-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathworkflow_execution.txt
More file actions
40 lines (32 loc) · 1.23 KB
/
workflow_execution.txt
File metadata and controls
40 lines (32 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import com.mindee.input.LocalInputSource;
import com.mindee.v1.MindeeClient;
import com.mindee.v1.parsing.common.WorkflowResponse;
import com.mindee.v1.product.generated.GeneratedV1;
import com.mindee.v1.http.MindeeHttpExceptionV1;
import java.io.IOException;
public class SimpleMindeeClientV1 {
public static void main(String[] args) throws IOException {
String apiKey = "my-api-key";
String workflowId = "workflow-id";
String filePath = "/path/to/the/file.ext";
// Init a new client
MindeeClient mindeeClient = new MindeeClient(apiKey);
// Load a file from disk
LocalInputSource inputSource = new LocalInputSource(filePath);
// Send the file to a workflow
WorkflowResponse response = mindeeClient.executeWorkflow(
workflowId,
inputSource
);
// Alternatively: give an alias to the document
// WorkflowResponse response = mindeeClient.executeWorkflow(
// workflowId,
// inputSource,
// WorkflowOptions.builder().alias("my-alias").build()
// );
// Print the workflow ID.
System.out.println(response.getExecution().getId());
// Print the inference result.
// System.out.println(response.getExecution().getInference());
}
}