Skip to content

Commit

Permalink
Added Inline samples for from_document_path() and `from_documentai_…
Browse files Browse the repository at this point in the history
…document()`
  • Loading branch information
holtskinner committed Mar 27, 2023
1 parent 9a2758f commit 3d48aaa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions google/cloud/documentai_toolbox/wrappers/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ def from_document_path(
):
r"""Loads Document from local document_path.
.. code-block:: python
from google.cloud.documentai_toolbox import document
document_path = "/path/to/local/file.json
wrapped_document = document.Document.from_document_path(document_path)
Args:
document_path (str):
Required. The path to the document.json file.
Expand All @@ -243,6 +250,14 @@ def from_documentai_document(
):
r"""Loads Document from local documentai_document.
.. code-block:: python
from google.cloud import documentai
from google.cloud.documentai_toolbox import document
documentai_document = client.process_documents(request).document
wrapped_document = document.Document.from_documentai_document(documentai_document)
Args:
documentai_document (documentai.Document):
Optional. The Document.proto response.
Expand Down

0 comments on commit 3d48aaa

Please sign in to comment.