Skip to content
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
32 changes: 32 additions & 0 deletions docs/code_samples/workflow_ots_rag.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const mindee = require("mindee");
// for TS or modules:
// import * as mindee from "mindee";

const workflowId: string = "workflow-id";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });

// Load a file from disk
const inputSource = mindeeClient.docFromPath(
"/path/to/the/file.ext"
);

// Configure the RAG-enabled workflow
const workflowParams = {
rag: true,
workflowId: workflowId
};

// Parse the file asynchronously on a workflow queue
const asyncApiResponse = mindeeClient.enqueueAndParse(
mindee.product.FinancialDocumentV1,
inputSource,
workflowParams
);

// Handle the response Promise
asyncApiResponse.then((resp) => {
// print a string summary
console.log(resp.document?.toString());
});
5 changes: 2 additions & 3 deletions docs/code_samples/workflow_polling.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const customEndpoint = mindeeClient.createEndpoint(
"my-version" // Defaults to "1"
);

// Configure the RAG-enabled workflow
const workflowParams = {
rag: true,
workflowId: workflowId,
Expand All @@ -29,12 +30,10 @@ const asyncApiResponse = mindeeClient.enqueueAndParse(
mindee.product.GeneratedV1,
inputSource,
workflowParams
// Optionally: send an alias & priority
// { alias: "my-alias", priority: ExecutionPriority.low }
);

// Handle the response Promise
asyncApiResponse.then((resp) => {
// print a string summary
console.log(resp.document?.toString());
});
});