Skip to content

Commit

Permalink
mindeeapi.py aktualisieren
Browse files Browse the repository at this point in the history
More api changes
  • Loading branch information
DrRSatzteil authored Jan 5, 2024
1 parent 6b7d442 commit 9428805
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mayanmindee/mindeeapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ def ocr_standard(pdf_bytes, document_name, document_type):


def ocr_custom(pdf_bytes, document_name, account_name, endpoint_name):
client = Client(api_key=os.getenv("MINDEE_API_KEY")).create_endpoint(
client = Client(api_key=os.getenv("MINDEE_API_KEY"))
custom_endpoint = client.create_endpoint(
account_name=account_name,
endpoint_name=endpoint_name,
)
doc = client.source_from_bytes(pdf_bytes, document_name)
parsed_doc = doc.parse(product.TypeCustomV1, endpoint_name=endpoint_name)
parsed_doc = client.parse(product.CustomV1, input_source=doc, endpoint=custom_endpoint)
return parsed_doc

0 comments on commit 9428805

Please sign in to comment.