Skip to content

Commit 3959526

Browse files
Merge branch 'googleapis:main' into fix/option-to-set-fps-in-video-metadata
2 parents aa385fe + cffa558 commit 3959526

File tree

308 files changed

+35630
-5737
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+35630
-5737
lines changed

.kokoro/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
3636
# Remove old nox
3737
python3 -m pip uninstall --yes --quiet nox-automation
3838

39+
# Match the docker version to the one used by the test runner for CPR
40+
export DOCKER_API_VERSION=1.39
41+
3942
# Install nox
4043
python3 -m pip install --upgrade --quiet uv nox
4144
python3 -m nox --version

.kokoro/test-samples-impl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ env | grep KOKORO
3434

3535
# Install nox
3636
# `virtualenv==20.26.6` is added for Python 3.7 compatibility
37-
python3 -m pip install --upgrade --quiet nox uv virtualenv==20.26.6
37+
python3 -m pip install --upgrade --quiet nox virtualenv==20.26.6
3838

3939
# Use secrets acessor service account to get secrets
4040
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.124.0"
2+
".": "1.132.0"
33
}

CHANGELOG.md

Lines changed: 199 additions & 0 deletions
Large diffs are not rendered by default.

gemini_docs/vertexai/vertexai.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Vertex AI SDK
66
:show-inheritance:
77
:inherited-members:
88

9+
.. autoattribute:: types
10+
911
.. autoclass:: vertexai.Client
1012
:members:
1113
:undoc-members:
@@ -37,6 +39,11 @@ Vertex AI SDK
3739
:undoc-members:
3840
:show-inheritance:
3941

42+
.. automodule:: vertexai._genai.types
43+
:members:
44+
:undoc-members:
45+
:show-inheritance:
46+
4047
.. automodule:: vertexai.generative_models
4148
:members:
4249
:show-inheritance:

google/cloud/aiplatform/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__ = "1.124.0" # {x-release-please-version}
16+
__version__ = "1.132.0" # {x-release-please-version}

google/cloud/aiplatform/initializer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def _set_async_rest_credentials(credentials: AsyncCredentials):
722722
+ "google-auth >= 2.35.0.\n\n"
723723
+ "Install the following dependencies:\n"
724724
+ "pip install google-api-core[grpc, async_rest] >= 2.21.0\n"
725-
+ "pip install google-auth[aiohttp] >= 2.35.0\n\n"
725+
+ "pip install google-auth[aiohttp] >= 2.45.0\n\n"
726726
+ "Example usage:\n"
727727
+ "from google.auth.aio.credentials import StaticCredentials\n"
728728
+ "async_credentials = StaticCredentials(token=YOUR_TOKEN_HERE)\n"

google/cloud/aiplatform/jobs.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def cancel(self) -> None:
319319
getattr(self.api_client, self._cancel_method)(name=self.resource_name)
320320

321321

322-
class BatchPredictionJob(_Job):
322+
class BatchPredictionJob(_Job, base.PreviewMixin):
323323

324324
_resource_noun = "batchPredictionJobs"
325325
_getter_method = "get_batch_prediction_job"
@@ -329,6 +329,9 @@ class BatchPredictionJob(_Job):
329329
_job_type = "batch-predictions"
330330
_parse_resource_name_method = "parse_batch_prediction_job_path"
331331
_format_resource_name_method = "batch_prediction_job_path"
332+
_preview_class = (
333+
"google.cloud.aiplatform.aiplatform.preview.jobs.BatchPredictionJob"
334+
)
332335

333336
def __init__(
334337
self,
@@ -949,6 +952,9 @@ def _submit_impl(
949952
] = None,
950953
analysis_instance_schema_uri: Optional[str] = None,
951954
service_account: Optional[str] = None,
955+
reservation_affinity_type: Optional[str] = None,
956+
reservation_affinity_key: Optional[str] = None,
957+
reservation_affinity_values: Optional[Sequence[str]] = None,
952958
wait_for_completion: bool = False,
953959
) -> "BatchPredictionJob":
954960
"""Create a batch prediction job.
@@ -1136,6 +1142,18 @@ def _submit_impl(
11361142
service_account (str):
11371143
Optional. Specifies the service account for workload run-as account.
11381144
Users submitting jobs must have act-as permission on this run-as account.
1145+
reservation_affinity_type (str):
1146+
Optional. The type of reservation affinity.
1147+
One of NO_RESERVATION, ANY_RESERVATION, SPECIFIC_RESERVATION,
1148+
SPECIFIC_THEN_ANY_RESERVATION, SPECIFIC_THEN_NO_RESERVATION
1149+
reservation_affinity_key (str):
1150+
Optional. Corresponds to the label key of a reservation resource.
1151+
To target a SPECIFIC_RESERVATION by name, use `compute.googleapis.com/reservation-name` as the key
1152+
and specify the name of your reservation as its value.
1153+
reservation_affinity_values (List[str]):
1154+
Optional. Corresponds to the label values of a reservation resource.
1155+
This must be the full resource name of the reservation.
1156+
Format: 'projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}'
11391157
wait_for_completion (bool):
11401158
Whether to wait for the job completion.
11411159
Returns:
@@ -1268,6 +1286,13 @@ def _submit_impl(
12681286
machine_spec.accelerator_type = accelerator_type
12691287
machine_spec.accelerator_count = accelerator_count
12701288

1289+
if reservation_affinity_type:
1290+
machine_spec.reservation_affinity = utils.get_reservation_affinity(
1291+
reservation_affinity_type,
1292+
reservation_affinity_key,
1293+
reservation_affinity_values,
1294+
)
1295+
12711296
dedicated_resources = gca_machine_resources_compat.BatchDedicatedResources()
12721297

12731298
dedicated_resources.machine_spec = machine_spec

google/cloud/aiplatform/matching_engine/matching_engine_index_endpoint.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
from dataclasses import dataclass, field
19-
from typing import Dict, List, Optional, Sequence, Tuple, Union
19+
from typing import Dict, List, Optional, Sequence, Tuple, Union, Any, Mapping
2020

2121
from google.auth import credentials as auth_credentials
2222
from google.cloud.aiplatform import base
@@ -208,6 +208,8 @@ class MatchNeighbor:
208208
For example, values [1,2,3] with dimensions [4,5,6] means value 1 is
209209
of the 4th dimension, value 2 is of the 4th dimension, and value 3 is
210210
of the 6th dimension.
211+
embedding_metadata (Mapping[str, Any]):
212+
Optional. The corresponding embedding metadata of the matching datapoint.
211213
212214
"""
213215

@@ -220,6 +222,7 @@ class MatchNeighbor:
220222
numeric_restricts: Optional[List[NumericNamespace]] = None
221223
sparse_embedding_values: Optional[List[float]] = None
222224
sparse_embedding_dimensions: Optional[List[int]] = None
225+
embedding_metadata: Optional[Mapping[str, Any]] = None
223226

224227
def from_index_datapoint(
225228
self, index_datapoint: gca_index_v1beta1.IndexDatapoint
@@ -276,6 +279,9 @@ def from_index_datapoint(
276279
self.sparse_embedding_dimensions = (
277280
index_datapoint.sparse_embedding.dimensions
278281
)
282+
# retrieve embedding metadata
283+
if index_datapoint.embedding_metadata is not None:
284+
self.embedding_metadata = index_datapoint.embedding_metadata
279285
return self
280286

281287
def from_embedding(self, embedding: match_service_pb2.Embedding) -> "MatchNeighbor":
@@ -702,10 +708,10 @@ def _get_psc_automated_deployed_index_ip_address(
702708
psc_network: Optional[str] = None,
703709
) -> str:
704710
"""Helper method to get the ip address for a psc automated endpoint.
705-
Returns:
711+
Args:
706712
deployed_index_id (str):
707-
Optional. Required for private service access endpoint.
708-
The user specified ID of the DeployedIndex.
713+
Optional. Required for private service access endpoint.
714+
The user specified ID of the DeployedIndex.
709715
deployed_index (gca_matching_engine_index_endpoint.DeployedIndex):
710716
Optional. Required for private service access endpoint.
711717
The DeployedIndex resource.
@@ -722,6 +728,9 @@ def _get_psc_automated_deployed_index_ip_address(
722728
MatchingEngineIndexEndpoint instance, if the ip address is
723729
already known.
724730
731+
Returns:
732+
str: The IP address for the PSC automated endpoint.
733+
725734
Raises:
726735
RuntimeError: No valid ip found for deployed index with id
727736
deployed_index_id within network psc_network, invalid PSC

0 commit comments

Comments
 (0)