Skip to content

Commit 93f3058

Browse files
authored
📝 match sample code with gitbook (#381)
1 parent 8f98ebc commit 93f3058

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
from mindee import ClientV2, SplitParameters, SplitResponse, PathInput
1+
from mindee import (
2+
ClientV2,
3+
PathInput,
4+
SplitParameters,
5+
SplitResponse,
6+
)
27

38
input_path = "/path/to/the/file.ext"
49
api_key = "MY_API_KEY"
@@ -7,7 +12,7 @@ model_id = "MY_SPLIT_MODEL_ID"
712
# Init a new client
813
mindee_client = ClientV2(api_key)
914

10-
# Set inference parameters
15+
# Set parameters
1116
params = SplitParameters(
1217
# ID of the model, required.
1318
model_id=model_id,
@@ -16,7 +21,7 @@ params = SplitParameters(
1621
# Load a file from disk
1722
input_source = PathInput(input_path)
1823

19-
# Send for processing
24+
# Send for processing using polling
2025
response = mindee_client.enqueue_and_get_result(
2126
SplitResponse,
2227
input_source,
@@ -25,3 +30,6 @@ response = mindee_client.enqueue_and_get_result(
2530

2631
# Print a brief summary of the parsed data
2732
print(response.inference)
33+
34+
# Access the split result
35+
splits: list = response.inference.result.splits

0 commit comments

Comments
 (0)