Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: googleapis/python-aiplatform
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.41.0
Choose a base ref
...
head repository: googleapis/python-aiplatform
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.42.0
Choose a head ref
Loading
Showing with 2,090 additions and 398 deletions.
  1. +0 −5 .coveragerc
  2. +1 −1 .release-please-manifest.json
  3. +36 −0 CHANGELOG.md
  4. +28 −0 google/cloud/aiplatform/compat/__init__.py
  5. +16 −0 google/cloud/aiplatform/compat/services/__init__.py
  6. +12 −0 google/cloud/aiplatform/compat/types/__init__.py
  7. +1 −1 google/cloud/aiplatform/gapic_version.py
  8. +2 −4 google/cloud/aiplatform/initializer.py
  9. +138 −32 google/cloud/aiplatform/matching_engine/matching_engine_index_endpoint.py
  10. +1 −1 google/cloud/aiplatform/metadata/experiment_run_resource.py
  11. +11 −5 google/cloud/aiplatform/models.py
  12. +2 −0 google/cloud/aiplatform/preview/vertex_ray/__init__.py
  13. +17 −1 google/cloud/aiplatform/preview/vertex_ray/cluster_init.py
  14. +18 −6 google/cloud/aiplatform/preview/vertex_ray/util/_gapic_utils.py
  15. +20 −0 google/cloud/aiplatform/preview/vertex_ray/util/resources.py
  16. +38 −0 google/cloud/aiplatform/utils/__init__.py
  17. +2 −2 google/cloud/aiplatform/utils/prediction_utils.py
  18. +1 −1 google/cloud/aiplatform/v1/schema/predict/instance/gapic_version.py
  19. +1 −1 google/cloud/aiplatform/v1/schema/predict/instance_v1/gapic_version.py
  20. +1 −1 google/cloud/aiplatform/v1/schema/predict/params/gapic_version.py
  21. +1 −1 google/cloud/aiplatform/v1/schema/predict/params_v1/gapic_version.py
  22. +1 −1 google/cloud/aiplatform/v1/schema/predict/prediction/gapic_version.py
  23. +1 −1 google/cloud/aiplatform/v1/schema/predict/prediction_v1/gapic_version.py
  24. +1 −1 google/cloud/aiplatform/v1/schema/trainingjob/definition/gapic_version.py
  25. +1 −1 google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/gapic_version.py
  26. +1 −1 google/cloud/aiplatform/v1beta1/schema/predict/instance/gapic_version.py
  27. +1 −1 google/cloud/aiplatform/v1beta1/schema/predict/instance_v1beta1/gapic_version.py
  28. +1 −1 google/cloud/aiplatform/v1beta1/schema/predict/params/gapic_version.py
  29. +1 −1 google/cloud/aiplatform/v1beta1/schema/predict/params_v1beta1/gapic_version.py
  30. +1 −1 google/cloud/aiplatform/v1beta1/schema/predict/prediction/gapic_version.py
  31. +1 −1 google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/gapic_version.py
  32. +1 −1 google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/gapic_version.py
  33. +1 −1 google/cloud/aiplatform/v1beta1/schema/trainingjob/definition_v1beta1/gapic_version.py
  34. +1 −1 google/cloud/aiplatform/version.py
  35. +1 −1 google/cloud/aiplatform_v1/gapic_version.py
  36. +12 −0 google/cloud/aiplatform_v1beta1/__init__.py
  37. +1 −1 google/cloud/aiplatform_v1beta1/gapic_version.py
  38. +12 −0 google/cloud/aiplatform_v1beta1/types/__init__.py
  39. +125 −0 google/cloud/aiplatform_v1beta1/types/content.py
  40. +1 −2 google/cloud/aiplatform_v1beta1/types/prediction_service.py
  41. +91 −1 google/cloud/aiplatform_v1beta1/types/tool.py
  42. +3 −5 owlbot.py
  43. +1 −1 samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json
  44. +1 −1 samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json
  45. +1 −1 samples/model-builder/experiment_tracking/log_time_series_metrics_sample.py
  46. +13 −4 samples/model-builder/experiment_tracking/log_time_series_metrics_sample_test.py
  47. +4 −1 setup.py
  48. +0 −14 testing/constraints-3.7.txt
  49. +5 −3 testing/constraints-3.8.txt
  50. +2 −4 tests/system/aiplatform/test_dataset.py
  51. +33 −0 tests/system/aiplatform/test_vision_models.py
  52. +16 −1 tests/system/vertexai/test_generative_models.py
  53. +15 −14 tests/unit/aiplatform/test_endpoints.py
  54. +143 −10 tests/unit/aiplatform/test_matching_engine_index_endpoint.py
  55. +0 −22 tests/unit/aiplatform/test_model_garden_models.py
  56. +1 −1 tests/unit/aiplatform/test_utils.py
  57. +379 −0 tests/unit/aiplatform/test_vision_models.py
  58. +42 −0 tests/unit/vertex_ray/test_cluster_init.py
  59. +27 −0 tests/unit/vertex_ray/test_constants.py
  60. +174 −53 tests/unit/vertexai/test_generative_models.py
  61. +0 −44 vertexai/_model_garden/_model_garden_models.py
  62. +3 −6 vertexai/generative_models/README.md
  63. +51 −0 vertexai/generative_models/__init__.py
  64. +232 −35 vertexai/generative_models/_generative_models.py
  65. +3 −4 vertexai/language_models/_evaluatable_language_models.py
  66. +0 −20 vertexai/language_models/_language_models.py
  67. +9 −1 vertexai/preview/generative_models.py
  68. +6 −3 vertexai/preview/vision_models.py
  69. +6 −0 vertexai/vision_models/__init__.py
  70. +317 −70 vertexai/vision_models/_vision_models.py
5 changes: 0 additions & 5 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -11,8 +11,3 @@ exclude_lines =
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.41.0"
".": "1.42.0"
}
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## [1.42.0](https://github.com/googleapis/python-aiplatform/compare/v1.41.0...v1.42.0) (2024-02-15)


### Features

* Add Candidate.grounding_metadata ([310ee49](https://github.com/googleapis/python-aiplatform/commit/310ee49a11767c20bed9cc4a929cbb0b8b3e6940))
* Add GoogleSearchRetrieval ([310ee49](https://github.com/googleapis/python-aiplatform/commit/310ee49a11767c20bed9cc4a929cbb0b8b3e6940))
* Add metadata in model.predict output for LLMs ([4661e58](https://github.com/googleapis/python-aiplatform/commit/4661e581ea957e71c643afc6bbf3b2e729b38bc8))
* Add Retrieval ([310ee49](https://github.com/googleapis/python-aiplatform/commit/310ee49a11767c20bed9cc4a929cbb0b8b3e6940))
* Add Tool.google_search_retrieval ([310ee49](https://github.com/googleapis/python-aiplatform/commit/310ee49a11767c20bed9cc4a929cbb0b8b3e6940))
* Add Tool.retrieval ([310ee49](https://github.com/googleapis/python-aiplatform/commit/310ee49a11767c20bed9cc4a929cbb0b8b3e6940))
* Add VertexAiSearch ([310ee49](https://github.com/googleapis/python-aiplatform/commit/310ee49a11767c20bed9cc4a929cbb0b8b3e6940))
* GenAI - Added `to_dict()` methods to response and content classes ([a78748e](https://github.com/googleapis/python-aiplatform/commit/a78748e5cbe7b86ddfb1a36a4c0e5be8f66b27c3))
* GenAI - Added support for Grounding ([0c3e294](https://github.com/googleapis/python-aiplatform/commit/0c3e29421434fe36d0f583f9860ac2e3f60e0329))
* GenAI - Added the `GenerativeModel.start_chat(response_validation: bool = True)` parameter ([94f7cd9](https://github.com/googleapis/python-aiplatform/commit/94f7cd9e454d593e2544f8d93771d3093ffc18ae))
* GenAI - GAPIC - Added support for Grounding ([310ee49](https://github.com/googleapis/python-aiplatform/commit/310ee49a11767c20bed9cc4a929cbb0b8b3e6940))
* GenAI - Release the GenerativeModel to GA ([c7e3f07](https://github.com/googleapis/python-aiplatform/commit/c7e3f076f91f002ac5a889d8942a153e57e0147c))
* LLM - Add newly supported model `text-bison@002`, update pipeline template version and prediction row limit for pipeline-based LLM Evaluation SDK ([35e57b3](https://github.com/googleapis/python-aiplatform/commit/35e57b32e70902fc90ee5a39e9001d3fa4150c50))
* LVM - Add GCS URI support for Imagen Models (`imagetext`, `imagegeneration`) ([4109ea8](https://github.com/googleapis/python-aiplatform/commit/4109ea8d8ad456d90c0ca476e2147e9543e15b43))
* LVM - Added support for Images from GCS uri for multimodal embeddings ([90d95d7](https://github.com/googleapis/python-aiplatform/commit/90d95d778f94e598a78a6f1c8a38e1911bffd8e2))
* LVM - Added support for Videos from GCS uri for multimodal embeddings ([f3bd3bf](https://github.com/googleapis/python-aiplatform/commit/f3bd3bf1f74d283d7a95cd9cddf39947fcabc514))
* Support custom image for Ray cluster creation ([d727189](https://github.com/googleapis/python-aiplatform/commit/d7271899a5383ffef69af1c46ad28d92eb4d5751))


### Bug Fixes

* Add google-auth as a direct dependency ([ecc6454](https://github.com/googleapis/python-aiplatform/commit/ecc64544d3cc718957fbe472fef1eaf22818e093))
* Add restricts and crowding tag to `MatchingEngineIndexEndpoint` query response. ([83cb52d](https://github.com/googleapis/python-aiplatform/commit/83cb52d1ed3ec7587ea9bb877dba113abad569be))
* Remove usage of distutils ([e35ab64](https://github.com/googleapis/python-aiplatform/commit/e35ab64d7e47f696ef9dd9c071c2d322e705b5ff))


### Documentation

* Fix incorrect field in log_time_series_metrics_sample ([f249353](https://github.com/googleapis/python-aiplatform/commit/f249353b918823b35495b295a75a90528ad652c0))
* Update README ([14b41b5](https://github.com/googleapis/python-aiplatform/commit/14b41b50aff89e15f5f86f814df122c96231841d))

## [1.41.0](https://github.com/googleapis/python-aiplatform/compare/v1.40.0...v1.41.0) (2024-02-05)


28 changes: 28 additions & 0 deletions google/cloud/aiplatform/compat/__init__.py
Original file line number Diff line number Diff line change
@@ -30,6 +30,12 @@
services.deployment_resource_pool_service_client_v1beta1
)
services.endpoint_service_client = services.endpoint_service_client_v1beta1
services.feature_online_store_admin_service_client = (
services.feature_online_store_admin_service_client_v1beta1
)
services.feature_online_store_service_client = (
services.feature_online_store_service_client_v1beta1
)
services.featurestore_online_serving_service_client = (
services.featurestore_online_serving_service_client_v1beta1
)
@@ -79,8 +85,16 @@
types.explanation = types.explanation_v1beta1
types.explanation_metadata = types.explanation_metadata_v1beta1
types.feature = types.feature_v1beta1
types.feature_group = types.feature_group_v1beta1
types.feature_monitoring_stats = types.feature_monitoring_stats_v1beta1
types.feature_online_store = types.feature_online_store_v1beta1
types.feature_online_store_admin_service = (
types.feature_online_store_admin_service_v1beta1
)
types.feature_online_store_service = types.feature_online_store_service_v1beta1
types.feature_selector = types.feature_selector_v1beta1
types.feature_view = types.feature_view_v1beta1
types.feature_view_sync = types.feature_view_sync_v1beta1
types.featurestore = types.featurestore_v1beta1
types.featurestore_monitoring = types.featurestore_monitoring_v1beta1
types.featurestore_online_service = types.featurestore_online_service_v1beta1
@@ -140,6 +154,12 @@

services.dataset_service_client = services.dataset_service_client_v1
services.endpoint_service_client = services.endpoint_service_client_v1
services.feature_online_store_admin_service_client = (
services.feature_online_store_admin_service_client_v1
)
services.feature_online_store_service_client = (
services.feature_online_store_service_client_v1
)
services.featurestore_online_serving_service_client = (
services.featurestore_online_serving_service_client_v1
)
@@ -182,8 +202,16 @@
types.explanation = types.explanation_v1
types.explanation_metadata = types.explanation_metadata_v1
types.feature = types.feature_v1
types.feature_group = types.feature_group_v1
types.feature_monitoring_stats = types.feature_monitoring_stats_v1
types.feature_online_store = types.feature_online_store_v1
types.feature_online_store_admin_service = (
types.feature_online_store_admin_service_v1
)
types.feature_online_store_service = types.feature_online_store_service_v1
types.feature_selector = types.feature_selector_v1
types.feature_view = types.feature_view_v1
types.feature_view_sync = types.feature_view_sync_v1
types.featurestore = types.featurestore_v1
types.featurestore_online_service = types.featurestore_online_service_v1
types.featurestore_service = types.featurestore_service_v1
16 changes: 16 additions & 0 deletions google/cloud/aiplatform/compat/services/__init__.py
Original file line number Diff line number Diff line change
@@ -24,6 +24,12 @@
from google.cloud.aiplatform_v1beta1.services.endpoint_service import (
client as endpoint_service_client_v1beta1,
)
from google.cloud.aiplatform_v1beta1.services.feature_online_store_service import (
client as feature_online_store_service_client_v1beta1,
)
from google.cloud.aiplatform_v1beta1.services.feature_online_store_admin_service import (
client as feature_online_store_admin_service_client_v1beta1,
)
from google.cloud.aiplatform_v1beta1.services.featurestore_online_serving_service import (
client as featurestore_online_serving_service_client_v1beta1,
)
@@ -82,6 +88,12 @@
from google.cloud.aiplatform_v1.services.endpoint_service import (
client as endpoint_service_client_v1,
)
from google.cloud.aiplatform_v1.services.feature_online_store_service import (
client as feature_online_store_service_client_v1,
)
from google.cloud.aiplatform_v1.services.feature_online_store_admin_service import (
client as feature_online_store_admin_service_client_v1,
)
from google.cloud.aiplatform_v1.services.featurestore_online_serving_service import (
client as featurestore_online_serving_service_client_v1,
)
@@ -132,6 +144,8 @@
# v1
dataset_service_client_v1,
endpoint_service_client_v1,
feature_online_store_service_client_v1,
feature_online_store_admin_service_client_v1,
featurestore_online_serving_service_client_v1,
featurestore_service_client_v1,
index_service_client_v1,
@@ -151,6 +165,8 @@
dataset_service_client_v1beta1,
deployment_resource_pool_service_client_v1beta1,
endpoint_service_client_v1beta1,
feature_online_store_service_client_v1beta1,
feature_online_store_admin_service_client_v1beta1,
featurestore_online_serving_service_client_v1beta1,
featurestore_service_client_v1beta1,
index_service_client_v1beta1,
12 changes: 12 additions & 0 deletions google/cloud/aiplatform/compat/types/__init__.py
Original file line number Diff line number Diff line change
@@ -42,8 +42,14 @@
explanation as explanation_v1beta1,
explanation_metadata as explanation_metadata_v1beta1,
feature as feature_v1beta1,
feature_group as feature_group_v1beta1,
feature_monitoring_stats as feature_monitoring_stats_v1beta1,
feature_online_store as feature_online_store_v1beta1,
feature_online_store_admin_service as feature_online_store_admin_service_v1beta1,
feature_online_store_service as feature_online_store_service_v1beta1,
feature_selector as feature_selector_v1beta1,
feature_view as feature_view_v1beta1,
feature_view_sync as feature_view_sync_v1beta1,
featurestore as featurestore_v1beta1,
featurestore_monitoring as featurestore_monitoring_v1beta1,
featurestore_online_service as featurestore_online_service_v1beta1,
@@ -119,8 +125,14 @@
explanation as explanation_v1,
explanation_metadata as explanation_metadata_v1,
feature as feature_v1,
feature_group as feature_group_v1,
feature_monitoring_stats as feature_monitoring_stats_v1,
feature_online_store as feature_online_store_v1,
feature_online_store_admin_service as feature_online_store_admin_service_v1,
feature_online_store_service as feature_online_store_service_v1,
feature_selector as feature_selector_v1,
feature_view as feature_view_v1,
feature_view_sync as feature_view_sync_v1,
featurestore as featurestore_v1,
featurestore_online_service as featurestore_online_service_v1,
featurestore_service as featurestore_service_v1,
2 changes: 1 addition & 1 deletion google/cloud/aiplatform/gapic_version.py
Original file line number Diff line number Diff line change
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.41.0" # {x-release-please-version}
__version__ = "1.42.0" # {x-release-please-version}
6 changes: 2 additions & 4 deletions google/cloud/aiplatform/initializer.py
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@
from concurrent import futures
import inspect
import logging
import pkg_resources # noqa: F401 # Note this is used after copybara replacement
import os
import types
from typing import Iterator, List, Optional, Type, TypeVar, Union
@@ -30,6 +29,7 @@
from google.auth import credentials as auth_credentials
from google.auth.exceptions import GoogleAuthError

from google.cloud.aiplatform import __version__
from google.cloud.aiplatform import compat
from google.cloud.aiplatform.constants import base as constants
from google.cloud.aiplatform import utils
@@ -447,9 +447,7 @@ def create_client(
Returns:
client: Instantiated Vertex AI Service client with optional overrides
"""
gapic_version = pkg_resources.get_distribution(
"google-cloud-aiplatform",
).version
gapic_version = __version__

if appended_gapic_version:
gapic_version = f"{gapic_version}+{appended_gapic_version}"
Loading