Skip to content

Commit 74d2c84

Browse files
authored
📝 match sample code with gitbook
1 parent 8f98ebc commit 74d2c84

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

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

38
input_path = "/path/to/the/file.ext"
49
api_key = "MY_API_KEY"
5-
model_id = "MY_SPLIT_MODEL_ID"
10+
model_id = "MY_MODEL_ID"
611

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 result
35+
result: dict = response.inference.result

0 commit comments

Comments
 (0)