Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update client libraries for Enterprise OCR add-ons #11642

Merged
merged 3 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.18.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.18.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.transport.requests import AuthorizedSession # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.protobuf import json_format
import grpc # type: ignore
from requests import __version__ as requests_version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1235,14 +1235,12 @@ class NormalizedValue(proto.Message):
date_value (google.type.date_pb2.Date):
Date value. Includes year, month, day. See
also:

https://github.com/googleapis/googleapis/blob/master/google/type/date.proto

This field is a member of `oneof`_ ``structured_value``.
datetime_value (google.type.datetime_pb2.DateTime):
DateTime value. Includes date, time, and
timezone. See also:

https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto

This field is a member of `oneof`_ ``structured_value``.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.18.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.rpc import status_pb2 # type: ignore

from google.cloud.documentai_v1beta2.types import document, document_understanding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.rpc import status_pb2 # type: ignore

from google.cloud.documentai_v1beta2.types import document, document_understanding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class Label(proto.Message):
This field is a member of `oneof`_ ``source``.
name (str):
Name of the label.

When the label is generated from AutoML Text
Classification model, this field represents the
name of the category.
Expand Down Expand Up @@ -1286,14 +1287,12 @@ class NormalizedValue(proto.Message):
date_value (google.type.date_pb2.Date):
Date value. Includes year, month, day. See
also:

https://github.com/googleapis/googleapis/blob/master/google/type/date.proto

This field is a member of `oneof`_ ``structured_value``.
datetime_value (google.type.datetime_pb2.DateTime):
DateTime value. Includes date, time, and
timezone. See also:

https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto

This field is a member of `oneof`_ ``structured_value``.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.18.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.transport.requests import AuthorizedSession # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.protobuf import json_format
import grpc # type: ignore
from requests import __version__ as requests_version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore

from google.cloud.documentai_v1beta3.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore

from google.cloud.documentai_v1beta3.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.transport.requests import AuthorizedSession # type: ignore
from google.cloud.location import locations_pb2 # type: ignore
from google.longrunning import operations_pb2
from google.protobuf import json_format
import grpc # type: ignore
from requests import __version__ as requests_version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1240,14 +1240,12 @@ class NormalizedValue(proto.Message):
date_value (google.type.date_pb2.Date):
Date value. Includes year, month, day. See
also:

https://github.com/googleapis/googleapis/blob/master/google/type/date.proto

This field is a member of `oneof`_ ``structured_value``.
datetime_value (google.type.datetime_pb2.DateTime):
DateTime value. Includes date, time, and
timezone. See also:

https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto

This field is a member of `oneof`_ ``structured_value``.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,16 @@ class OcrConfig(proto.Message):
Includes symbol level OCR information if set
to true.
compute_style_info (bool):
Turn on font id model and returns font style
information.
Turn on font identification model and return font style
information. Deprecated, use
[PremiumFeatures.compute_style_info][google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.compute_style_info]
instead.
disable_character_boxes_detection (bool):
Turn off character box detector in OCR
engine. Character box detection is enabled by
default in OCR 2.0+ processors.
premium_features (google.cloud.documentai_v1beta3.types.OcrConfig.PremiumFeatures):
Configurations for premium OCR features.
"""

class Hints(proto.Message):
Expand All @@ -275,6 +283,34 @@ class Hints(proto.Message):
number=1,
)

class PremiumFeatures(proto.Message):
r"""Configurations for premium OCR features.

Attributes:
enable_selection_mark_detection (bool):
Turn on selection mark detector in OCR
engine. Only available in OCR 2.0+ processors.
compute_style_info (bool):
Turn on font identification model and return
font style information.
enable_math_ocr (bool):
Turn on the model that can extract LaTeX math
formulas.
"""

enable_selection_mark_detection: bool = proto.Field(
proto.BOOL,
number=3,
)
compute_style_info: bool = proto.Field(
proto.BOOL,
number=4,
)
enable_math_ocr: bool = proto.Field(
proto.BOOL,
number=5,
)

hints: Hints = proto.Field(
proto.MESSAGE,
number=2,
Expand All @@ -300,6 +336,15 @@ class Hints(proto.Message):
proto.BOOL,
number=8,
)
disable_character_boxes_detection: bool = proto.Field(
proto.BOOL,
number=10,
)
premium_features: PremiumFeatures = proto.Field(
proto.MESSAGE,
number=11,
message=PremiumFeatures,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,63 @@
class ProcessOptions(proto.Message):
r"""Options for Process API

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.

.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes:
individual_page_selector (google.cloud.documentai_v1beta3.types.ProcessOptions.IndividualPageSelector):
Which pages to process (1-indexed).

This field is a member of `oneof`_ ``page_range``.
from_start (int):
Only process certain pages from the start,
process all if the document has less pages.

This field is a member of `oneof`_ ``page_range``.
from_end (int):
Only process certain pages from the end, same
as above.

This field is a member of `oneof`_ ``page_range``.
ocr_config (google.cloud.documentai_v1beta3.types.OcrConfig):
Only applicable to ``OCR_PROCESSOR``. Returns error if set
on other processor types.
"""

class IndividualPageSelector(proto.Message):
r"""A list of individual page numbers.

Attributes:
pages (MutableSequence[int]):
Optional. Indices of the pages (starting from
1).
"""

pages: MutableSequence[int] = proto.RepeatedField(
proto.INT32,
number=1,
)

individual_page_selector: IndividualPageSelector = proto.Field(
proto.MESSAGE,
number=5,
oneof="page_range",
message=IndividualPageSelector,
)
from_start: int = proto.Field(
proto.INT32,
number=6,
oneof="page_range",
)
from_end: int = proto.Field(
proto.INT32,
number=7,
oneof="page_range",
)
ocr_config: document_io.OcrConfig = proto.Field(
proto.MESSAGE,
number=1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-documentai",
"version": "2.18.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-documentai",
"version": "2.18.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-documentai",
"version": "2.18.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.cloud.location import locations_pb2
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.oauth2 import service_account
from google.protobuf import any_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.cloud.location import locations_pb2
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.oauth2 import service_account
from google.rpc import status_pb2 # type: ignore
import grpc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.cloud.location import locations_pb2
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.oauth2 import service_account
from google.protobuf import any_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.cloud.location import locations_pb2
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2 # type: ignore
from google.oauth2 import service_account
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import json_format
Expand Down