Skip to content

Commit d4f363c

Browse files
♻️ add integration failure reporting & update documentation (#216)
1 parent a89ea4c commit d4f363c

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

.github/workflows/test-code-samples.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,13 @@ jobs:
4545
- name: Tests code samples
4646
run: |
4747
./tests/test_code_samples.sh ${{ secrets.MINDEE_ACCOUNT_SE_TESTS }} ${{ secrets.MINDEE_ENDPOINT_SE_TESTS }} ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
48+
49+
- name: Notify Slack Action on Failure
50+
uses: ravsamhq/notify-slack-action@2.3.0
51+
if: ${{ always() && github.ref_name == 'main' }}
52+
with:
53+
status: ${{ job.status }}
54+
notify_when: "failure"
55+
notification_title: "{workflow} is failing"
56+
env:
57+
SLACK_WEBHOOK_URL: ${{ secrets.PRODUCTION_ISSUES_SLACK_HOOK_URL }}

docs/extras/guide/generated_v1.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ Generated APIs can theoretically support all APIs in a catch-all generic format.
77
# Quick-Start
88

99
```python
10-
from mindee import Client, product
10+
from mindee import Client, PredictResponse, product
1111

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

15-
# Add your custom endpoint (document)
15+
# Add the corresponding endpoint (document). Set the account_name to "mindee" if you are using OTS.
1616
my_endpoint = mindee_client.create_endpoint(
1717
account_name="my-account",
1818
endpoint_name="my-endpoint",
19-
version="my-version" # Note: version should be always provided when using for OTS products
19+
version="my-version"
2020
)
2121

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

2525
# Parse the file.
2626
# The endpoint must be specified since it cannot be determined from the class.
27-
result = mindee_client.parse(
27+
result: PredictResponse = mindee_client.enqueue_and_parse(
2828
product.GeneratedV1,
2929
input_doc,
3030
endpoint=my_endpoint
@@ -33,9 +33,9 @@ result = mindee_client.parse(
3333
# Print a brief summary of the parsed data
3434
print(result.document)
3535

36-
# Iterate over all the fields in the document
37-
for field_name, field_values in result.document.fields.items():
38-
print(field_name, "=", field_values)
36+
# # Iterate over all the fields in the document
37+
# for field_name, field_values in result.document.inference.prediction.fields.items():
38+
# print(field_name, "=", field_values)
3939
```
4040

4141
# Generated Endpoints

mindee/parsing/generated/generated_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(
4646

4747
def _str_level(self, level=0) -> str:
4848
"""
49-
ReSTructured-complient string representation.
49+
ReSTructured-compliant string representation.
5050
5151
Takes into account level of indentation & displays elements as list elements.
5252

0 commit comments

Comments
 (0)