Skip to content

Commit

Permalink
feat: [google-cloud-documentai] A new field imageless_mode is added…
Browse files Browse the repository at this point in the history
… to message `.google.cloud.documentai.v1.ProcessRequest` (#12966)

- [ ] Regenerate this pull request now.

docs: Keep the API doc up-to-date with recent changes

PiperOrigin-RevId: 657890649

Source-Link:
googleapis/googleapis@51c59a2

Source-Link:
googleapis/googleapis-gen@043503e
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6IjA0MzUwM2UzZmUxNmM5MDhmYzAyOTJiMDFmMjJiZGRhMTg0ZjY3OGMifQ==

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jul 31, 2024
1 parent 3e53ea9 commit 60d0728
Show file tree
Hide file tree
Showing 23 changed files with 249 additions and 20 deletions.
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.29.3" # {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.29.3" # {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.29.3" # {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.29.3" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,11 @@ async def create_processor(
r"""Creates a processor from the
[ProcessorType][google.cloud.documentai.v1beta3.ProcessorType]
provided. The processor will be at ``ENABLED`` state by default
after its creation.
after its creation. Note that this method requires the
``documentai.processors.create`` permission on the project,
which is highly privileged. A user or service account with this
permission can create new processors that can interact with any
gcs bucket in your project.
.. code-block:: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2393,7 +2393,11 @@ def create_processor(
r"""Creates a processor from the
[ProcessorType][google.cloud.documentai.v1beta3.ProcessorType]
provided. The processor will be at ``ENABLED`` state by default
after its creation.
after its creation. Note that this method requires the
``documentai.processors.create`` permission on the project,
which is highly privileged. A user or service account with this
permission can create new processors that can interact with any
gcs bucket in your project.
.. code-block:: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,11 @@ def create_processor(
Creates a processor from the
[ProcessorType][google.cloud.documentai.v1beta3.ProcessorType]
provided. The processor will be at ``ENABLED`` state by default
after its creation.
after its creation. Note that this method requires the
``documentai.processors.create`` permission on the project,
which is highly privileged. A user or service account with this
permission can create new processors that can interact with any
gcs bucket in your project.
Returns:
Callable[[~.CreateProcessorRequest],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,11 @@ def create_processor(
Creates a processor from the
[ProcessorType][google.cloud.documentai.v1beta3.ProcessorType]
provided. The processor will be at ``ENABLED`` state by default
after its creation.
after its creation. Note that this method requires the
``documentai.processors.create`` permission on the project,
which is highly privileged. A user or service account with this
permission can create new processors that can interact with any
gcs bucket in your project.
Returns:
Callable[[~.CreateProcessorRequest],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,12 @@ async def update_dataset(
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Updates metadata associated with a dataset.
r"""Updates metadata associated with a dataset. Note that this
method requires the
``documentai.googleapis.com/datasets.update`` permission on the
project, which is highly privileged. A user or service account
with this permission can create new processors that can interact
with any gcs bucket in your project.
.. code-block:: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,12 @@ def update_dataset(
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
r"""Updates metadata associated with a dataset.
r"""Updates metadata associated with a dataset. Note that this
method requires the
``documentai.googleapis.com/datasets.update`` permission on the
project, which is highly privileged. A user or service account
with this permission can create new processors that can interact
with any gcs bucket in your project.
.. code-block:: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@ def update_dataset(
) -> Callable[[document_service.UpdateDatasetRequest], operations_pb2.Operation]:
r"""Return a callable for the update dataset method over gRPC.
Updates metadata associated with a dataset.
Updates metadata associated with a dataset. Note that this
method requires the
``documentai.googleapis.com/datasets.update`` permission on the
project, which is highly privileged. A user or service account
with this permission can create new processors that can interact
with any gcs bucket in your project.
Returns:
Callable[[~.UpdateDatasetRequest],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,12 @@ def update_dataset(
]:
r"""Return a callable for the update dataset method over gRPC.
Updates metadata associated with a dataset.
Updates metadata associated with a dataset. Note that this
method requires the
``documentai.googleapis.com/datasets.update`` permission on the
project, which is highly privileged. A user or service account
with this permission can create new processors that can interact
with any gcs bucket in your project.
Returns:
Callable[[~.UpdateDatasetRequest],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ class Dataset(proto.Message):
state (google.cloud.documentai_v1beta3.types.Dataset.State):
Required. State of the dataset. Ignored when
updating dataset.
satisfies_pzs (bool):
Output only. Reserved for future use.
satisfies_pzi (bool):
Output only. Reserved for future use.
"""

class State(proto.Enum):
Expand Down Expand Up @@ -176,6 +180,14 @@ class SpannerIndexingConfig(proto.Message):
number=2,
enum=State,
)
satisfies_pzs: bool = proto.Field(
proto.BOOL,
number=8,
)
satisfies_pzi: bool = proto.Field(
proto.BOOL,
number=9,
)


class DocumentId(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2079,9 +2079,7 @@ class Chunk(proto.Message):
chunk_id (str):
ID of the chunk.
source_block_ids (MutableSequence[str]):
DO NOT USE.
List of all parsed documents layout source
blocks used to generate the chunk.
Unused.
content (str):
Text content of the chunk.
page_span (google.cloud.documentai_v1beta3.types.Document.ChunkedDocument.Chunk.ChunkPageSpan):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ class ProcessRequest(proto.Message):
underscores, and dashes. International
characters are allowed. Label values are
optional. Label keys must start with a letter.
imageless_mode (bool):
Optional. Option to remove images from the
document.
"""

inline_document: gcd_document.Document = proto.Field(
Expand Down Expand Up @@ -341,6 +344,10 @@ class ProcessRequest(proto.Message):
proto.STRING,
number=10,
)
imageless_mode: bool = proto.Field(
proto.BOOL,
number=11,
)


class HumanReviewStatus(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,10 @@ class ListDocumentsRequest(proto.Message):
https://google.aip.dev/160.
Currently support query strings are:
------------------------------------
``SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED``
- ``SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED``
- ``LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED``
- ``DisplayName=\"file_name.pdf\"``
- ``EntityType=abc/def``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ class ProcessorVersion(proto.Message):
model_type (google.cloud.documentai_v1beta3.types.ProcessorVersion.ModelType):
Output only. The model type of this processor
version.
satisfies_pzs (bool):
Output only. Reserved for future use.
satisfies_pzi (bool):
Output only. Reserved for future use.
gen_ai_model_info (google.cloud.documentai_v1beta3.types.ProcessorVersion.GenAiModelInfo):
Output only. Information about Generative AI
model-based processor versions.
"""

class State(proto.Enum):
Expand Down Expand Up @@ -151,6 +158,102 @@ class DeprecationInfo(proto.Message):
number=2,
)

class GenAiModelInfo(proto.Message):
r"""Information about Generative AI model-based processor
versions.
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:
foundation_gen_ai_model_info (google.cloud.documentai_v1beta3.types.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo):
Information for a pretrained Google-managed
foundation model.
This field is a member of `oneof`_ ``model_info``.
custom_gen_ai_model_info (google.cloud.documentai_v1beta3.types.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo):
Information for a custom Generative AI model
created by the user.
This field is a member of `oneof`_ ``model_info``.
"""

class FoundationGenAiModelInfo(proto.Message):
r"""Information for a pretrained Google-managed foundation model.
Attributes:
finetuning_allowed (bool):
Whether finetuning is allowed for this base
processor version.
min_train_labeled_documents (int):
The minimum number of labeled documents in
the training dataset required for finetuning.
"""

finetuning_allowed: bool = proto.Field(
proto.BOOL,
number=1,
)
min_train_labeled_documents: int = proto.Field(
proto.INT32,
number=2,
)

class CustomGenAiModelInfo(proto.Message):
r"""Information for a custom Generative AI model created by the user.
These are created with ``Create New Version`` in either the
``Call foundation model`` or ``Fine tuning`` tabs.
Attributes:
custom_model_type (google.cloud.documentai_v1beta3.types.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType):
The type of custom model created by the user.
base_processor_version_id (str):
The base processor version ID for the custom
model.
"""

class CustomModelType(proto.Enum):
r"""The type of custom model created by the user.
Values:
CUSTOM_MODEL_TYPE_UNSPECIFIED (0):
The model type is unspecified.
VERSIONED_FOUNDATION (1):
The model is a versioned foundation model.
FINE_TUNED (2):
The model is a finetuned foundation model.
"""
CUSTOM_MODEL_TYPE_UNSPECIFIED = 0
VERSIONED_FOUNDATION = 1
FINE_TUNED = 2

custom_model_type: "ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType" = proto.Field(
proto.ENUM,
number=1,
enum="ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType",
)
base_processor_version_id: str = proto.Field(
proto.STRING,
number=2,
)

foundation_gen_ai_model_info: "ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo" = proto.Field(
proto.MESSAGE,
number=1,
oneof="model_info",
message="ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo",
)
custom_gen_ai_model_info: "ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo" = proto.Field(
proto.MESSAGE,
number=2,
oneof="model_info",
message="ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo",
)

name: str = proto.Field(
proto.STRING,
number=1,
Expand Down Expand Up @@ -201,6 +304,19 @@ class DeprecationInfo(proto.Message):
number=15,
enum=ModelType,
)
satisfies_pzs: bool = proto.Field(
proto.BOOL,
number=16,
)
satisfies_pzi: bool = proto.Field(
proto.BOOL,
number=17,
)
gen_ai_model_info: GenAiModelInfo = proto.Field(
proto.MESSAGE,
number=18,
message=GenAiModelInfo,
)


class ProcessorVersionAlias(proto.Message):
Expand Down Expand Up @@ -256,6 +372,10 @@ class Processor(proto.Message):
The `KMS
key <https://cloud.google.com/security-key-management>`__
used for encryption and decryption in CMEK scenarios.
satisfies_pzs (bool):
Output only. Reserved for future use.
satisfies_pzi (bool):
Output only. Reserved for future use.
"""

class State(proto.Enum):
Expand Down Expand Up @@ -344,6 +464,14 @@ class State(proto.Enum):
proto.STRING,
number=8,
)
satisfies_pzs: bool = proto.Field(
proto.BOOL,
number=12,
)
satisfies_pzi: bool = proto.Field(
proto.BOOL,
number=13,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-documentai",
"version": "2.29.3"
"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.29.3"
"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.29.3"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Loading

0 comments on commit 60d0728

Please sign in to comment.