Skip to content
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
14 changes: 14 additions & 0 deletions .github/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve
processes:
- "OwlBotTemplateChanges"
14 changes: 14 additions & 0 deletions .github/header-checker-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

{"allowedCopyrightHolders": ["Google LLC"],
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/__init__.py", "samples/**/constraints.txt", "samples/**/constraints-test.txt"],
Expand Down
14 changes: 14 additions & 0 deletions .github/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

releaseType: python
handleGHRelease: true
manifest: true
Expand Down
14 changes: 14 additions & 0 deletions .github/release-trigger.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

enabled: true
multiScmName: python-aiplatform
14 changes: 14 additions & 0 deletions .github/workflows/block_major_releases.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This workflow blocks release-please PRs for major versions unless they have at least 2 approvals.
name: Enforce Multiple Approvals for Major Releases

Expand All @@ -15,7 +29,7 @@
pull-requests: read
steps:
- name: Enforce Multiple Approvals for Major Releases
uses: actions/github-script@v8

Check failure on line 32 in .github/workflows/block_major_releases.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 32 in .github/workflows/block_major_releases.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

block_major_releases.yml:32: unpinned action reference: action is not pinned to a hash (required by blanket policy)
with:
script: |
const prTitle = context.payload.pull_request.title;
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/google-contributor-stale.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This workflow closes PRs that have had no activity for 14 days.
name: Close inactive google-contributor PRs

Expand All @@ -14,7 +28,7 @@
issues: write

steps:
- uses: actions/stale@v10

Check failure on line 31 in .github/workflows/google-contributor-stale.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 31 in .github/workflows/google-contributor-stale.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

google-contributor-stale.yml:31: unpinned action reference: action is not pinned to a hash (required by blanket policy)
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
any-of-labels: "google-contributor"
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This workflow runs mypy for static type checking on the vertexai/_genai submodule.
# See https://mypy.readthedocs.io/en/stable/index.html for more information.
#
Expand All @@ -10,7 +24,7 @@
- main

jobs:
genai-mypy:

Check warning on line 27 in .github/workflows/mypy.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

excessive-permissions

mypy.yml:27: overly broad permissions: default permissions used due to no permissions: block
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -18,10 +32,10 @@

steps:
- name: Checkout code
uses: actions/checkout@v4

Check failure on line 35 in .github/workflows/mypy.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 35 in .github/workflows/mypy.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

mypy.yml:35: unpinned action reference: action is not pinned to a hash (required by blanket policy)

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5

Check failure on line 38 in .github/workflows/mypy.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 38 in .github/workflows/mypy.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

mypy.yml:38: unpinned action reference: action is not pinned to a hash (required by blanket policy)
with:
python-version: ${{ matrix.python-version }}

Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This workflow warns and then closes issues that have had no activity for a specified amount of time.
name: Mark and close stale issues

Expand All @@ -14,7 +28,7 @@
issues: write

steps:
- uses: actions/stale@v10

Check failure on line 31 in .github/workflows/stale.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 31 in .github/workflows/stale.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

stale.yml:31: unpinned action reference: action is not pinned to a hash (required by blanket policy)
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 7
Expand Down
14 changes: 14 additions & 0 deletions .sample_configs/process_configs.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

global:
api_endpoint: us-central1-aiplatform.googleapis.com
api_endpoint_comment: The AI Platform services require regional API endpoints.
Expand Down
14 changes: 14 additions & 0 deletions .sample_configs/variants.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

batch_delete_data_items:
- ''
batch_migrate_resources:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for method_signature."""

from inspect import signature
Expand Down
14 changes: 14 additions & 0 deletions tests/system/aiplatform/test_vizier.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest

from google.api_core import exceptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def test_public_method_generate_rubrics_with_metric(client):
"""Tests the public generate_rubrics method with a metric."""
client._api_client._http_options.api_version = "v1beta1"
client._api_client._http_options.base_url = (
"https://us-central1-staging-aiplatform.sandbox.googleapis.com/"
"https://us-central1-aiplatform.googleapis.com/"
)
metric_resource_name = "projects/977012026409/locations/us-central1/evaluationMetrics/6048334299558576128"
metric = types.Metric(
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/agentplatform/genai/replays/test_skills_delete.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests the skills.delete() method against the prod endpoint."""

from tests.unit.agentplatform.genai.replays import pytest_helper
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/agentplatform/genai/replays/test_skills_get.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests the skills.get() method against the prod endpoint."""

from google.api_core import exceptions
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/agentplatform/genai/replays/test_skills_list.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests the skills.list() method against the prod endpoint."""

from tests.unit.agentplatform.genai.replays import pytest_helper
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/agentplatform/genai/replays/test_skills_retrieve.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests the skills.retrieve() method against the autopush endpoint."""

from tests.unit.agentplatform.genai.replays import pytest_helper
Expand Down
13 changes: 13 additions & 0 deletions tests/unit/agentplatform/genai/run_replay_tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
#!/bin/bash
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This script runs replay tests for the Vertex SDK GenAI client
# It is intended to be used from the google3 directory of a CitC client.
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/agentplatform/genai/test_sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_send_command(self, mock_get_api_client):
mock_sandbox = mock.Mock()
mock_sandbox.connection_info.load_balancer_ip = None
mock_sandbox.connection_info.load_balancer_hostname = (
"test-us-central1.sandbox.vertexai.goog"
"test-us-central1.example.vertexai.goog"
)
mock_sandbox.connection_info.routing_token = "test_routing_token"
mock_http_client = mock_get_api_client.return_value
Expand All @@ -100,7 +100,7 @@ def test_send_command(self, mock_get_api_client):
_, kwargs = call_args
http_options = kwargs["http_options"]
assert http_options.base_url == (
"https://test-us-central1.sandbox.vertexai.goog/test/path"
"https://test-us-central1.example.vertexai.goog/test/path"
)
assert http_options.headers["Authorization"] == "Bearer test_token"

Expand All @@ -116,7 +116,7 @@ def test_generate_browser_ws_headers(
mock_sandbox = mock.Mock()
mock_sandbox.connection_info.load_balancer_ip = None
mock_sandbox.connection_info.load_balancer_hostname = (
"test-us-central1.sandbox.vertexai.goog"
"test-us-central1.example.vertexai.goog"
)
mock_sandbox.connection_info.routing_token = "test_routing_token"
mock_http_client = mock_get_api_client.return_value
Expand All @@ -130,7 +130,7 @@ def test_generate_browser_ws_headers(
timeout=3600,
)
)
assert ws_url == "wss://test-us-central1.sandbox.vertexai.goog/test/endpoint"
assert ws_url == "wss://test-us-central1.example.vertexai.goog/test/endpoint"
assert (
headers["Sec-WebSocket-Protocol"]
== "v1.stream, test_token, test_routing_token, 9222"
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/vertex_ray/test_prediction_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Test utils for Prediction Tests."""

import numpy as np
Expand Down
3 changes: 1 addition & 2 deletions vertexai/generative_models/_generative_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2400,8 +2400,7 @@ def _fix_schema_dict_for_gapic_in_place(schema_dict: Dict[str, Any]) -> None:
# those listed in "properties". We remove this because that is
# already our default behavior.
# True: This means that additional properties are allowed with any value
# type. We replace this with an equivalent empty dict:
# https://screenshot.googleplex.com/yvgmAmZay5Dw7qY
# type. We replace this with an equivalent empty dict.
if (additional := schema_dict.get("additionalProperties")) is not None:
if additional is False:
del schema_dict["additionalProperties"]
Expand Down
14 changes: 14 additions & 0 deletions vertexai/language_models/_distillation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Optional, Union

from google.cloud import aiplatform
Expand Down
Loading
Loading