Skip to content

Commit 1a2b325

Browse files
feat: [google-cloud-documentai] Add API fields for the descriptions of entity type and property in the document schema (googleapis#13067)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 671472365 Source-Link: googleapis/googleapis@003e626 Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf0196fe2004e1fbb1edf5aa8d8ada653e10d62c Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6ImJmMDE5NmZlMjAwNGUxZmJiMWVkZjVhYThkOGFkYTY1M2UxMGQ2MmMifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent a7f0dbf commit 1a2b325

File tree

5 files changed

+33
-5
lines changed

5 files changed

+33
-5
lines changed

packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document_schema.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ class EntityType(proto.Message):
189189
type. For example ``line_item/amount``. This convention
190190
is deprecated, but will still be honored for backward
191191
compatibility.
192+
description (str):
193+
The description of the entity type. Could be
194+
used to provide more information about the
195+
entity type for model calls.
192196
base_types (MutableSequence[str]):
193197
The entity type that this type is derived
194198
from. For now, one and only one should be set.
@@ -220,6 +224,10 @@ class Property(proto.Message):
220224
name (str):
221225
The name of the property. Follows the same
222226
guidelines as the EntityType name.
227+
description (str):
228+
The description of the property. Could be
229+
used to provide more information about the
230+
property for model calls.
223231
display_name (str):
224232
User defined name for the property.
225233
value_type (str):
@@ -274,6 +282,10 @@ class OccurrenceType(proto.Enum):
274282
proto.STRING,
275283
number=1,
276284
)
285+
description: str = proto.Field(
286+
proto.STRING,
287+
number=7,
288+
)
277289
display_name: str = proto.Field(
278290
proto.STRING,
279291
number=6,
@@ -309,6 +321,10 @@ class OccurrenceType(proto.Enum):
309321
proto.STRING,
310322
number=1,
311323
)
324+
description: str = proto.Field(
325+
proto.STRING,
326+
number=15,
327+
)
312328
base_types: MutableSequence[str] = proto.RepeatedField(
313329
proto.STRING,
314330
number=2,

packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document_service.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,8 @@ class ListDocumentsRequest(proto.Message):
396396
https://google.aip.dev/160.
397397
398398
Currently support query strings are:
399-
------------------------------------
400-
401-
``SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED``
402399
400+
- ``SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED``
403401
- ``LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED``
404402
- ``DisplayName=\"file_name.pdf\"``
405403
- ``EntityType=abc/def``
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../scripts/client-post-processing/doc-formatting.yaml

packages/google-cloud-documentai/tests/unit/gapic/documentai_v1beta3/test_document_service.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6117,10 +6117,12 @@ def test_update_dataset_schema_rest(request_type):
61176117
"enum_values": {"values": ["values_value1", "values_value2"]},
61186118
"display_name": "display_name_value",
61196119
"name": "name_value",
6120+
"description": "description_value",
61206121
"base_types": ["base_types_value1", "base_types_value2"],
61216122
"properties": [
61226123
{
61236124
"name": "name_value",
6125+
"description": "description_value",
61246126
"display_name": "display_name_value",
61256127
"value_type": "value_type_value",
61266128
"occurrence_type": 1,

scripts/client-post-processing/doc-formatting.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,20 @@ replacements:
161161
after: " 'ingestionTime': DOUBLE; (UNIX timestamp)\n 'application': STRING;\n"
162162
count: 2
163163
- paths: [
164-
packages/google-cloud-visionai/google/cloud/visionai_v1/types/platform.py,
164+
packages/google-cloud-visionai/google/cloud/visionai_v1/types/platform.py,
165165
]
166166
before: "'processor': STRING;\n }\n dynamic_config_input_topic "
167167
after: "'processor': STRING;\n\n }\n\n dynamic_config_input_topic "
168168
count: 1
169-
169+
- paths: [
170+
packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document_service.py,
171+
]
172+
before: |
173+
\n Currently support query strings are:
174+
\ ------------------------------------
175+
\
176+
\ ``SplitType=DATASET_SPLIT_TEST\|DATASET_SPLIT_TRAIN\|DATASET_SPLIT_UNASSIGNED``
177+
\
178+
\ - ``LabelingState=DOCUMENT_LABELED\|DOCUMENT_UNLABELED\|DOCUMENT_AUTO_LABELED``
179+
after: "\n Currently support query strings are:\n\n - ``SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED``\n - ``LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED``\n"
180+
count: 1

0 commit comments

Comments
 (0)