Skip to content

Commit

Permalink
♻️ add async invoice call & update doc (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee authored Jul 25, 2024
1 parent eb75930 commit 7ca1672
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
16 changes: 16 additions & 0 deletions docs/extras/code_samples/invoices_v4_async.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from mindee import Client, product, AsyncPredictResponse

# Init a new client
mindee_client = Client(api_key="my-api-key")

# Load a file from disk
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")

# Load a file from disk and enqueue it.
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
product.InvoiceV4,
input_doc,
)

# Print a brief summary of the parsed data
print(result.document)
2 changes: 0 additions & 2 deletions docs/extras/guide/financial_document_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ print(result.document)

# Print the document-level summary
# print(result.document.inference.prediction)

```

You can also call this product asynchronously:
Expand All @@ -47,7 +46,6 @@ result: AsyncPredictResponse = mindee_client.enqueue_and_parse(

# Print a brief summary of the parsed data
print(result.document)

```

**Output (RST):**
Expand Down
20 changes: 20 additions & 0 deletions docs/extras/guide/invoices_v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,27 @@ print(result.document)

# Print the document-level summary
# print(result.document.inference.prediction)
```

You can also call this product asynchronously:

```py
from mindee import Client, product, AsyncPredictResponse

# Init a new client
mindee_client = Client(api_key="my-api-key")

# Load a file from disk
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")

# Load a file from disk and enqueue it.
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
product.InvoiceV4,
input_doc,
)

# Print a brief summary of the parsed data
print(result.document)
```

**Output (RST):**
Expand Down

0 comments on commit 7ca1672

Please sign in to comment.