Skip to content

Commit af39eb3

Browse files
authored
♻️ harmonize names with other libs (#254)
1 parent 619d652 commit af39eb3

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

docs/code_samples/default_v2.txt

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,30 @@ import java.io.IOException;
77

88
public class SimpleMindeeClient {
99

10-
public static void main(String[] args) throws IOException, InterruptedException {
10+
public static void main(String[] args)
11+
throws IOException, InterruptedException
12+
{
1113
String apiKey = "MY_API_KEY";
1214
String filePath = "/path/to/the/file.ext";
1315
String modelId = "MY_MODEL_ID";
1416

1517
// Init a new client
1618
MindeeClientV2 mindeeClient = new MindeeClientV2(apiKey);
1719

18-
// Load a file from disk
19-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
20-
21-
// Prepare the enqueueing options
20+
// Set inference parameters
2221
// Note: modelId is mandatory.
23-
InferenceParameters options = InferenceParameters.builder(modelId).build();
22+
InferenceParameters options = InferenceParameters.builder(modelId)
23+
// If set to `true`, will enable Retrieval-Augmented Generation.
24+
.rag(false)
25+
.build();
26+
27+
// Load a file from disk
28+
LocalInputSource inputSource = new LocalInputSource(
29+
new File(filePath)
30+
);
2431

25-
// Parse the file
26-
InferenceResponse response = mindeeClient.enqueueAndGetInference(
32+
// Upload the file
33+
InferenceResponse response = mindeeClient.enqueueAndGetInference(
2734
inputSource,
2835
options
2936
);

src/main/java/com/mindee/input/LocalInputSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public LocalInputSource(String fileAsBase64, String filename) {
5555
* @param pageOptions The options specifying which pages to modify or retain in the PDF file.
5656
* @throws IOException If an I/O error occurs during the PDF operation.
5757
*/
58-
public void applyOperations (PageOptions pageOptions) throws IOException {
58+
public void applyPageOptions(PageOptions pageOptions) throws IOException {
5959
if (pageOptions != null && this.isPdf()) {
6060
PdfOperation pdfOperation = new PdfBoxApi();
6161
this.file = pdfOperation.split(

src/test/java/com/mindee/MindeeClientV2IT.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
1313
@Tag("integration")
1414
@DisplayName("MindeeClientV2 – integration tests (V2)")
15-
class MindeeClientV2IntegrationTest {
15+
class MindeeClientV2IT {
1616

1717
private MindeeClientV2 mindeeClient;
1818
private String modelId;
@@ -64,8 +64,9 @@ void parseFile_filledSinglePage_mustSucceed() throws IOException, InterruptedExc
6464
LocalInputSource source = new LocalInputSource(
6565
new File("src/test/resources/products/financial_document/default_sample.jpg"));
6666

67-
InferenceParameters options =
68-
InferenceParameters.builder(modelId).build();
67+
InferenceParameters options = InferenceParameters.builder(modelId)
68+
.rag(false)
69+
.build();
6970

7071
InferenceResponse response = mindeeClient.enqueueAndGetInference(source, options);
7172

0 commit comments

Comments
 (0)