Skip to content

Commit 69cfd79

Browse files
feat: [google-cloud-documentai] A new message FoundationModelTuningOptions is added (#12585)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE feat: A new message `FoundationModelTuningOptions` is added feat: A new field `foundation_model_tuning_options` is added to message `TrainProcessorVersionRequest` docs: updated comments END_COMMIT_OVERRIDE PiperOrigin-RevId: 625415406 Source-Link: googleapis/googleapis@caa099d Source-Link: googleapis/googleapis-gen@9168448 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6IjkxNjg0NDg2Y2M4NTBjODU2NDc5MjcyMDY5NGEyMGI4YzA0YzUwNjEifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 1392da5 commit 69cfd79

File tree

10 files changed

+49
-10
lines changed

10 files changed

+49
-10
lines changed

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.25.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.25.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,7 @@ class StyleInfo(proto.Message):
611611
pixel_font_size (float):
612612
Font size in pixels, equal to *unrounded
613613
[font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]*
614-
615-
- *resolution* ÷ ``72.0``.
614+
\* *resolution* ÷ ``72.0``.
616615
letter_spacing (float):
617616
Letter spacing in points.
618617
font_type (str):

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,10 @@ class TrainProcessorVersionRequest(proto.Message):
11551155
[TrainProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion]
11561156
method.
11571157
1158+
This message has `oneof`_ fields (mutually exclusive fields).
1159+
For each oneof, at most one member field can be set at the same time.
1160+
Setting any member of the oneof automatically clears all other
1161+
members.
11581162
11591163
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
11601164
@@ -1163,6 +1167,11 @@ class TrainProcessorVersionRequest(proto.Message):
11631167
Options to control Custom Document Extraction
11641168
(CDE) Processor.
11651169
1170+
This field is a member of `oneof`_ ``processor_flags``.
1171+
foundation_model_tuning_options (google.cloud.documentai_v1.types.TrainProcessorVersionRequest.FoundationModelTuningOptions):
1172+
Options to control foundation model tuning of
1173+
a processor.
1174+
11661175
This field is a member of `oneof`_ ``processor_flags``.
11671176
parent (str):
11681177
Required. The parent (project, location and processor) to
@@ -1239,12 +1248,43 @@ class TrainingMethod(proto.Enum):
12391248
enum="TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod",
12401249
)
12411250

1251+
class FoundationModelTuningOptions(proto.Message):
1252+
r"""Options to control foundation model tuning of the processor.
1253+
1254+
Attributes:
1255+
train_steps (int):
1256+
Optional. The number of steps to run for
1257+
model tuning. Valid values are between 1 and
1258+
400. If not provided, recommended steps will be
1259+
used.
1260+
learning_rate_multiplier (float):
1261+
Optional. The multiplier to apply to the
1262+
recommended learning rate. Valid values are
1263+
between 0.1 and 10. If not provided, recommended
1264+
learning rate will be used.
1265+
"""
1266+
1267+
train_steps: int = proto.Field(
1268+
proto.INT32,
1269+
number=2,
1270+
)
1271+
learning_rate_multiplier: float = proto.Field(
1272+
proto.FLOAT,
1273+
number=3,
1274+
)
1275+
12421276
custom_document_extraction_options: CustomDocumentExtractionOptions = proto.Field(
12431277
proto.MESSAGE,
12441278
number=5,
12451279
oneof="processor_flags",
12461280
message=CustomDocumentExtractionOptions,
12471281
)
1282+
foundation_model_tuning_options: FoundationModelTuningOptions = proto.Field(
1283+
proto.MESSAGE,
1284+
number=12,
1285+
oneof="processor_flags",
1286+
message=FoundationModelTuningOptions,
1287+
)
12481288
parent: str = proto.Field(
12491289
proto.STRING,
12501290
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.25.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

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.25.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-documentai/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-documentai",
11-
"version": "2.25.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-documentai/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-documentai",
11-
"version": "2.25.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-documentai/samples/generated_samples/snippet_metadata_google.cloud.documentai.v1beta3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-documentai",
11-
"version": "2.25.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-documentai/scripts/fixup_documentai_v1_keywords.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class documentaiCallTransformer(cst.CSTTransformer):
5959
'process_document': ('name', 'inline_document', 'raw_document', 'gcs_document', 'skip_human_review', 'field_mask', 'process_options', 'labels', ),
6060
'review_document': ('human_review_config', 'inline_document', 'enable_schema_validation', 'priority', 'document_schema', ),
6161
'set_default_processor_version': ('processor', 'default_processor_version', ),
62-
'train_processor_version': ('parent', 'processor_version', 'custom_document_extraction_options', 'document_schema', 'input_data', 'base_processor_version', ),
62+
'train_processor_version': ('parent', 'processor_version', 'custom_document_extraction_options', 'foundation_model_tuning_options', 'document_schema', 'input_data', 'base_processor_version', ),
6363
'undeploy_processor_version': ('name', ),
6464
}
6565

0 commit comments

Comments
 (0)