Skip to content

Commit 2fb9078

Browse files
feat: make page_range field public (#11751)
BEGIN_COMMIT_OVERRIDE feat: make page_range field public feat: Added SummaryOptions to ProcessOptions for the Summarizer processor feat: Added `ListDocuments()` method for Document AI Workbench training documents END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. fix: `OcrConfig.compute_style_info` is deprecated. Use `PremiumFeatures.compute_style_info` instead. PiperOrigin-RevId: 568225060 Source-Link: googleapis/googleapis@3cd21b1 Source-Link: googleapis/googleapis-gen@087cf52 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6IjA4N2NmNTIzZDFhMGQ5ZDUzZmU3ODMzYmM0ZDdiZjM2OWY4MmQzMzMifQ== BEGIN_NESTED_COMMIT feat: Added `SummaryOptions` to `ProcessOptions` for the Summarizer processor feat: Added `ListDocuments()` method for Document AI Workbench training documents PiperOrigin-RevId: 567684912 Source-Link: googleapis/googleapis@cac736f Source-Link: googleapis/googleapis-gen@cc556f3 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6ImNjNTU2ZjM5ZmJkZWQzMjI1MTNlNWJlMTZhNzRmYWJlYmMzMTQ2MGEifQ== END_NESTED_COMMIT --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: omair <omairn@google.com>
1 parent fdbdad8 commit 2fb9078

36 files changed

Lines changed: 2189 additions & 92 deletions

packages/google-cloud-documentai/CONTRIBUTING.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ Running System Tests
143143
$ nox -s system
144144

145145
# Run a single system test
146-
$ nox -s system- -- -k <name of test>
146+
$ nox -s system-3.11 -- -k <name of test>
147147

148148

149149
.. note::
150150

151-
System tests are only configured to run under Python.
151+
System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11.
152152
For expediency, we do not run them in older versions of Python 3.
153153

154154
This alone will not run the tests. You'll need to change some local

packages/google-cloud-documentai/docs/documentai_v1beta3/document_service.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ DocumentService
44
.. automodule:: google.cloud.documentai_v1beta3.services.document_service
55
:members:
66
:inherited-members:
7+
8+
.. automodule:: google.cloud.documentai_v1beta3.services.document_service.pagers
9+
:members:
10+
:inherited-members:

packages/google-cloud-documentai/google/cloud/documentai/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.19.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-documentai/google/cloud/documentai_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.19.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-documentai/google/cloud/documentai_v1/types/document_io.py

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class RawDocument(proto.Message):
4848
The display name of the document, it supports all Unicode
4949
characters except the following: ``*``, ``?``, ``[``, ``]``,
5050
``%``, ``{``, ``}``,\ ``'``, ``\"``, ``,`` ``~``, ``=`` and
51-
``:`` are reserved. If not specified, a default ID will be
51+
``:`` are reserved. If not specified, a default ID is
5252
generated.
5353
"""
5454

@@ -260,8 +260,16 @@ class OcrConfig(proto.Message):
260260
Includes symbol level OCR information if set
261261
to true.
262262
compute_style_info (bool):
263-
Turn on font id model and returns font style information.
264-
Use PremiumFeatures.compute_style_info instead.
263+
Turn on font identification model and return font style
264+
information. Deprecated, use
265+
[PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info]
266+
instead.
267+
disable_character_boxes_detection (bool):
268+
Turn off character box detector in OCR
269+
engine. Character box detection is enabled by
270+
default in OCR 2.0+ processors.
271+
premium_features (google.cloud.documentai_v1.types.OcrConfig.PremiumFeatures):
272+
Configurations for premium OCR features.
265273
"""
266274

267275
class Hints(proto.Message):
@@ -285,6 +293,34 @@ class Hints(proto.Message):
285293
number=1,
286294
)
287295

296+
class PremiumFeatures(proto.Message):
297+
r"""Configurations for premium OCR features.
298+
299+
Attributes:
300+
enable_selection_mark_detection (bool):
301+
Turn on selection mark detector in OCR
302+
engine. Only available in OCR 2.0+ processors.
303+
compute_style_info (bool):
304+
Turn on font identification model and return
305+
font style information.
306+
enable_math_ocr (bool):
307+
Turn on the model that can extract LaTeX math
308+
formulas.
309+
"""
310+
311+
enable_selection_mark_detection: bool = proto.Field(
312+
proto.BOOL,
313+
number=3,
314+
)
315+
compute_style_info: bool = proto.Field(
316+
proto.BOOL,
317+
number=4,
318+
)
319+
enable_math_ocr: bool = proto.Field(
320+
proto.BOOL,
321+
number=5,
322+
)
323+
288324
hints: Hints = proto.Field(
289325
proto.MESSAGE,
290326
number=2,
@@ -310,6 +346,15 @@ class Hints(proto.Message):
310346
proto.BOOL,
311347
number=8,
312348
)
349+
disable_character_boxes_detection: bool = proto.Field(
350+
proto.BOOL,
351+
number=10,
352+
)
353+
premium_features: PremiumFeatures = proto.Field(
354+
proto.MESSAGE,
355+
number=11,
356+
message=PremiumFeatures,
357+
)
313358

314359

315360
__all__ = tuple(sorted(__protobuf__.manifest))

packages/google-cloud-documentai/google/cloud/documentai_v1/types/document_processor_service.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,63 @@
9090
class ProcessOptions(proto.Message):
9191
r"""Options for Process API
9292
93+
This message has `oneof`_ fields (mutually exclusive fields).
94+
For each oneof, at most one member field can be set at the same time.
95+
Setting any member of the oneof automatically clears all other
96+
members.
97+
98+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
99+
93100
Attributes:
101+
individual_page_selector (google.cloud.documentai_v1.types.ProcessOptions.IndividualPageSelector):
102+
Which pages to process (1-indexed).
103+
104+
This field is a member of `oneof`_ ``page_range``.
105+
from_start (int):
106+
Only process certain pages from the start.
107+
Process all if the document has fewer pages.
108+
109+
This field is a member of `oneof`_ ``page_range``.
110+
from_end (int):
111+
Only process certain pages from the end, same
112+
as above.
113+
114+
This field is a member of `oneof`_ ``page_range``.
94115
ocr_config (google.cloud.documentai_v1.types.OcrConfig):
95116
Only applicable to ``OCR_PROCESSOR``. Returns error if set
96117
on other processor types.
97118
"""
98119

120+
class IndividualPageSelector(proto.Message):
121+
r"""A list of individual page numbers.
122+
123+
Attributes:
124+
pages (MutableSequence[int]):
125+
Optional. Indices of the pages (starting from
126+
1).
127+
"""
128+
129+
pages: MutableSequence[int] = proto.RepeatedField(
130+
proto.INT32,
131+
number=1,
132+
)
133+
134+
individual_page_selector: IndividualPageSelector = proto.Field(
135+
proto.MESSAGE,
136+
number=5,
137+
oneof="page_range",
138+
message=IndividualPageSelector,
139+
)
140+
from_start: int = proto.Field(
141+
proto.INT32,
142+
number=6,
143+
oneof="page_range",
144+
)
145+
from_end: int = proto.Field(
146+
proto.INT32,
147+
number=7,
148+
oneof="page_range",
149+
)
99150
ocr_config: document_io.OcrConfig = proto.Field(
100151
proto.MESSAGE,
101152
number=1,

packages/google-cloud-documentai/google/cloud/documentai_v1beta2/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.19.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-documentai/google/cloud/documentai_v1beta3/__init__.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,37 @@
9090
UndeployProcessorVersionRequest,
9191
UndeployProcessorVersionResponse,
9292
)
93-
from .types.document_schema import DocumentSchema, EntityTypeMetadata, PropertyMetadata
93+
from .types.document_schema import (
94+
DocumentSchema,
95+
EntityTypeMetadata,
96+
FieldExtractionMetadata,
97+
PropertyMetadata,
98+
SummaryOptions,
99+
)
94100
from .types.document_service import (
95101
BatchDeleteDocumentsMetadata,
96102
BatchDeleteDocumentsRequest,
97103
BatchDeleteDocumentsResponse,
98104
DatasetSplitType,
105+
DocumentLabelingState,
106+
DocumentMetadata,
99107
DocumentPageRange,
100108
GetDatasetSchemaRequest,
101109
GetDocumentRequest,
102110
GetDocumentResponse,
103111
ImportDocumentsMetadata,
104112
ImportDocumentsRequest,
105113
ImportDocumentsResponse,
114+
ListDocumentsRequest,
115+
ListDocumentsResponse,
106116
UpdateDatasetOperationMetadata,
107117
UpdateDatasetRequest,
108118
UpdateDatasetSchemaRequest,
109119
)
110120
from .types.evaluation import Evaluation, EvaluationReference
111121
from .types.geometry import BoundingPoly, NormalizedVertex, Vertex
112122
from .types.operation_metadata import CommonOperationMetadata
113-
from .types.processor import Processor, ProcessorVersion
123+
from .types.processor import Processor, ProcessorVersion, ProcessorVersionAlias
114124
from .types.processor_type import ProcessorType
115125

116126
__all__ = (
@@ -143,6 +153,8 @@
143153
"DisableProcessorResponse",
144154
"Document",
145155
"DocumentId",
156+
"DocumentLabelingState",
157+
"DocumentMetadata",
146158
"DocumentOutputConfig",
147159
"DocumentPageRange",
148160
"DocumentProcessorServiceClient",
@@ -159,6 +171,7 @@
159171
"EvaluationReference",
160172
"FetchProcessorTypesRequest",
161173
"FetchProcessorTypesResponse",
174+
"FieldExtractionMetadata",
162175
"GcsDocument",
163176
"GcsDocuments",
164177
"GcsPrefix",
@@ -176,6 +189,8 @@
176189
"ImportProcessorVersionMetadata",
177190
"ImportProcessorVersionRequest",
178191
"ImportProcessorVersionResponse",
192+
"ListDocumentsRequest",
193+
"ListDocumentsResponse",
179194
"ListEvaluationsRequest",
180195
"ListEvaluationsResponse",
181196
"ListProcessorTypesRequest",
@@ -192,6 +207,7 @@
192207
"Processor",
193208
"ProcessorType",
194209
"ProcessorVersion",
210+
"ProcessorVersionAlias",
195211
"PropertyMetadata",
196212
"RawDocument",
197213
"ReviewDocumentOperationMetadata",
@@ -201,6 +217,7 @@
201217
"SetDefaultProcessorVersionMetadata",
202218
"SetDefaultProcessorVersionRequest",
203219
"SetDefaultProcessorVersionResponse",
220+
"SummaryOptions",
204221
"TrainProcessorVersionMetadata",
205222
"TrainProcessorVersionRequest",
206223
"TrainProcessorVersionResponse",

packages/google-cloud-documentai/google/cloud/documentai_v1beta3/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,11 @@
394394
"import_documents"
395395
]
396396
},
397+
"ListDocuments": {
398+
"methods": [
399+
"list_documents"
400+
]
401+
},
397402
"UpdateDataset": {
398403
"methods": [
399404
"update_dataset"
@@ -429,6 +434,11 @@
429434
"import_documents"
430435
]
431436
},
437+
"ListDocuments": {
438+
"methods": [
439+
"list_documents"
440+
]
441+
},
432442
"UpdateDataset": {
433443
"methods": [
434444
"update_dataset"
@@ -464,6 +474,11 @@
464474
"import_documents"
465475
]
466476
},
477+
"ListDocuments": {
478+
"methods": [
479+
"list_documents"
480+
]
481+
},
467482
"UpdateDataset": {
468483
"methods": [
469484
"update_dataset"

packages/google-cloud-documentai/google/cloud/documentai_v1beta3/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.19.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

0 commit comments

Comments
 (0)