From 80704112095a39ea755ac25b3f5e3a76faaa03f1 Mon Sep 17 00:00:00 2001 From: A Vertex SDK engineer Date: Tue, 17 Sep 2024 12:45:46 -0700 Subject: [PATCH] feat: add support for partial failures sink in import rag files. PiperOrigin-RevId: 675672254 --- .kokoro/release.sh | 2 +- .kokoro/release/common.cfg | 2 +- .release-please-manifest.json | 2 +- CHANGELOG.md | 30 ---- README.rst | 16 +- docs/README.rst | 38 +++-- gemini_docs/README.md | 27 ++-- google/cloud/aiplatform/gapic_version.py | 2 +- .../cloud/aiplatform/tensorboard/uploader.py | 1 - .../schema/predict/instance/gapic_version.py | 2 +- .../predict/instance_v1/gapic_version.py | 2 +- .../v1/schema/predict/params/gapic_version.py | 2 +- .../schema/predict/params_v1/gapic_version.py | 2 +- .../predict/prediction/gapic_version.py | 2 +- .../predict/prediction_v1/gapic_version.py | 2 +- .../trainingjob/definition/gapic_version.py | 2 +- .../definition_v1/gapic_version.py | 2 +- .../schema/predict/instance/gapic_version.py | 2 +- .../predict/instance_v1beta1/gapic_version.py | 2 +- .../schema/predict/params/gapic_version.py | 2 +- .../predict/params_v1beta1/gapic_version.py | 2 +- .../predict/prediction/gapic_version.py | 2 +- .../prediction_v1beta1/gapic_version.py | 2 +- .../trainingjob/definition/gapic_version.py | 2 +- .../definition_v1beta1/gapic_version.py | 2 +- google/cloud/aiplatform/version.py | 2 +- google/cloud/aiplatform_v1/__init__.py | 2 - google/cloud/aiplatform_v1/gapic_version.py | 2 +- google/cloud/aiplatform_v1/types/__init__.py | 2 - google/cloud/aiplatform_v1/types/content.py | 105 ------------- google/cloud/aiplatform_v1/types/openapi.py | 9 -- .../aiplatform_v1/types/prediction_service.py | 37 +---- google/cloud/aiplatform_v1beta1/__init__.py | 10 -- .../cloud/aiplatform_v1beta1/gapic_version.py | 2 +- .../prediction_service/async_client.py | 22 +-- .../services/prediction_service/client.py | 22 +-- .../aiplatform_v1beta1/types/__init__.py | 12 -- .../cloud/aiplatform_v1beta1/types/content.py | 105 ------------- .../types/index_endpoint.py | 12 -- .../cloud/aiplatform_v1beta1/types/openapi.py | 9 -- .../aiplatform_v1beta1/types/pipeline_job.py | 118 -------------- .../types/prediction_service.py | 50 +----- .../types/service_networking.py | 28 ---- .../types/ui_pipeline_spec.py | 148 ------------------ pypi/_vertex_ai_placeholder/version.py | 2 +- ...t_metadata_google.cloud.aiplatform.v1.json | 2 +- ...adata_google.cloud.aiplatform.v1beta1.json | 2 +- setup.py | 5 +- .../system/vertexai/test_generative_models.py | 18 +-- tests/unit/aiplatform/test_language_models.py | 34 ---- tests/unit/aiplatform/test_uploader.py | 89 ++--------- .../aiplatform_v1/test_prediction_service.py | 24 +-- .../test_extension_registry_service.py | 2 - .../test_gen_ai_cache_service.py | 2 - .../test_index_endpoint_service.py | 9 -- .../test_pipeline_service.py | 25 --- .../test_prediction_service.py | 24 +-- .../test_schedule_service.py | 21 --- tests/unit/vertex_rag/test_rag_constants.py | 24 --- tests/unit/vertex_rag/test_rag_data.py | 26 --- .../evaluation/metrics/_default_templates.py | 4 +- .../generative_models/_generative_models.py | 113 +------------ vertexai/language_models/_language_models.py | 3 +- vertexai/preview/rag/__init__.py | 2 - vertexai/preview/rag/rag_data.py | 5 +- vertexai/preview/rag/utils/_gapic_utils.py | 58 +------ vertexai/preview/rag/utils/resources.py | 21 +-- 67 files changed, 130 insertions(+), 1234 deletions(-) delete mode 100644 google/cloud/aiplatform_v1beta1/types/ui_pipeline_spec.py diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 42c8c566fc..5ddfe573df 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -23,7 +23,7 @@ python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source / export PYTHONUNBUFFERED=1 # Move into the `google-cloud-aiplatform` package, build the distribution and upload. -GCA_TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-2") +GCA_TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") cd github/python-aiplatform python3 setup.py sdist bdist_wheel twine upload --username __token__ --password "${GCA_TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 93e46a1762..f1a3af8197 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -28,7 +28,7 @@ before_action { fetch_keystore { keystore_resource { keystore_config_id: 73713 - keyname: "google-cloud-pypi-token-keystore-2" + keyname: "google-cloud-pypi-token-keystore-1" } } } diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7f8daff1ba..c800b7cc66 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.67.1" + ".": "1.66.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 459da97fe3..2df0bf8a32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,35 +1,5 @@ # Changelog -## [1.67.1](https://github.com/googleapis/python-aiplatform/compare/v1.67.0...v1.67.1) (2024-09-18) - - -### Bug Fixes - -* Fix rag corpus creation error ([6083b93](https://github.com/googleapis/python-aiplatform/commit/6083b93848be6ec975c95cd072c8d86357339d02)) - -## [1.67.0](https://github.com/googleapis/python-aiplatform/compare/v1.66.0...v1.67.0) (2024-09-17) - - -### Features - -* Add support for partial failures sink in import rag files. ([07e471e](https://github.com/googleapis/python-aiplatform/commit/07e471e0a069551f2c855e167e549fa92ac6af95)) -* Adding Feature Store Vector DB option for RAG corpuses to SDK ([cfc3421](https://github.com/googleapis/python-aiplatform/commit/cfc3421fe8a883d459b66ed8c9f39697ded23f20)) -* Adding Pinecone Vector DB option for RAG corpuses to SDK ([f78b953](https://github.com/googleapis/python-aiplatform/commit/f78b953f561b8697d07a530e89c7e727db1161ed)) -* Adding Vertex Vector Search Vector DB option for RAG corpuses to SDK ([f882657](https://github.com/googleapis/python-aiplatform/commit/f882657183e34c8e07baa4b8dc9f45ed8bca9db7)) -* Allow customizing pipeline caching options for model evaluation jobs. ([73490b2](https://github.com/googleapis/python-aiplatform/commit/73490b22a239cb1a3c31349f8db6cfbc5232e231)) -* GenAI - Switched the GA version of the `generative_models` classes to use the v1 service APIs instead of v1beta1 ([66d84af](https://github.com/googleapis/python-aiplatform/commit/66d84afdd5b20f70b3ff62f25cc32ac0b324d5d5)) - - -### Bug Fixes - -* GenAI - Fixed `GenerativeModel.compute_tokens` for v1 API ([0de2987](https://github.com/googleapis/python-aiplatform/commit/0de298786c43427cb1a20b91cbabd1ce921c16da)) -* Tensorboard - Fix error in tensorboard batch upload of nested dirs ([ab157c8](https://github.com/googleapis/python-aiplatform/commit/ab157c8ead718b2a1a1d13306c1256c1cb2561f1)) - - -### Documentation - -* Manually add summary overview page. ([0bc608a](https://github.com/googleapis/python-aiplatform/commit/0bc608a9c045007f12325231ed7f0069a40f469b)) - ## [1.66.0](https://github.com/googleapis/python-aiplatform/compare/v1.65.0...v1.66.0) (2024-09-11) diff --git a/README.rst b/README.rst index 070715d556..5ea497c4b1 100644 --- a/README.rst +++ b/README.rst @@ -3,10 +3,6 @@ Vertex AI SDK for Python |GA| |pypi| |versions| |unit-tests| |system-tests| |sample-tests| -.. note:: - - For Gemini API and Generative AI on Vertex AI, please reference `Vertex Generative AI SDK for Python`_ -.. _Vertex Generative AI SDK for Python: https://cloud.google.com/vertex-ai/generative-ai/docs/reference/python/latest `Vertex AI`_: Google Vertex AI is an integrated suite of machine learning tools and services for building and using ML models with AutoML or custom code. It offers both novices and experts the best workbench for the entire machine learning development lifecycle. @@ -117,6 +113,18 @@ Vertex AI SDK resource based functionality can be used by importing the followin from google.cloud import aiplatform +Vertex AI SDK preview functionality can be used by importing the following namespace: + +.. code-block:: Python + + from vertexai import preview + +Vertex AI SDK general availability (GA) functionality can be used by importing the following namespace: + +.. code-block:: Python + + import vertexai + Initialization ^^^^^^^^^^^^^^ Initialize the SDK to store common configurations that you use with the SDK. diff --git a/docs/README.rst b/docs/README.rst index 070715d556..c393e30903 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -1,12 +1,7 @@ Vertex AI SDK for Python ================================================= -|GA| |pypi| |versions| |unit-tests| |system-tests| |sample-tests| - -.. note:: - - For Gemini API and Generative AI on Vertex AI, please reference `Vertex Generative AI SDK for Python`_ -.. _Vertex Generative AI SDK for Python: https://cloud.google.com/vertex-ai/generative-ai/docs/reference/python/latest +|GA| |pypi| |versions| `Vertex AI`_: Google Vertex AI is an integrated suite of machine learning tools and services for building and using ML models with AutoML or custom code. It offers both novices and experts the best workbench for the entire machine learning development lifecycle. @@ -19,16 +14,11 @@ Vertex AI SDK for Python :target: https://pypi.org/project/google-cloud-aiplatform/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-aiplatform.svg :target: https://pypi.org/project/google-cloud-aiplatform/ -.. |unit-tests| image:: https://storage.googleapis.com/cloud-devrel-public/python-aiplatform/badges/sdk-unit-tests.svg - :target: https://storage.googleapis.com/cloud-devrel-public/python-aiplatform/badges/sdk-unit-tests.html -.. |system-tests| image:: https://storage.googleapis.com/cloud-devrel-public/python-aiplatform/badges/sdk-system-tests.svg - :target: https://storage.googleapis.com/cloud-devrel-public/python-aiplatform/badges/sdk-system-tests.html -.. |sample-tests| image:: https://storage.googleapis.com/cloud-devrel-public/python-aiplatform/badges/sdk-sample-tests.svg - :target: https://storage.googleapis.com/cloud-devrel-public/python-aiplatform/badges/sdk-sample-tests.html .. _Vertex AI: https://cloud.google.com/vertex-ai/docs -.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/aiplatform/latest +.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/aiplatform/latest/summary_overview .. _Product Documentation: https://cloud.google.com/vertex-ai/docs + Quick Start ----------- @@ -69,6 +59,7 @@ Mac/Linux /bin/pip install google-cloud-aiplatform + Windows ^^^^^^^ @@ -79,7 +70,6 @@ Windows \Scripts\activate \Scripts\pip.exe install google-cloud-aiplatform - Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ Python >= 3.8 @@ -117,6 +107,18 @@ Vertex AI SDK resource based functionality can be used by importing the followin from google.cloud import aiplatform +Vertex AI SDK preview functionality can be used by importing the following namespace: + +.. code-block:: Python + + from vertexai import preview + +Vertex AI SDK general availability (GA) functionality can be used by importing the following namespace: + +.. code-block:: Python + + import vertexai + Initialization ^^^^^^^^^^^^^^ Initialize the SDK to store common configurations that you use with the SDK. @@ -173,8 +175,8 @@ You can also create and import a dataset in separate steps: my_dataset = aiplatform.TextDataset.create( display_name="my-dataset") - my_dataset.import_data( - gcs_source=['gs://path/to/my/dataset.csv'], + my_dataset.import( + gcs_source=['gs://path/to/my/dataset.csv'] import_schema_uri=aiplatform.schema.dataset.ioformat.text.multi_label_classification ) @@ -230,6 +232,7 @@ It must write the model artifact to the environment variable populated by the tr container_uri="us-docker.pkg.dev/vertex-ai/training/tf-cpu.2-2:latest", requirements=["gcsfs==0.7.1"], model_serving_container_image_uri="us-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-2:latest", + ) model = job.run(my_dataset, @@ -309,6 +312,7 @@ Please visit `Importing models to Vertex AI`_ for a detailed overview: .. _Importing models to Vertex AI: https://cloud.google.com/vertex-ai/docs/general/import-model + Model Evaluation ---------------- @@ -413,6 +417,7 @@ To get predictions from endpoints: endpoint.predict(instances=[[6.7, 3.1, 4.7, 1.5], [4.6, 3.1, 1.5, 0.2]]) + To undeploy models from an endpoint: .. code-block:: Python @@ -535,6 +540,7 @@ To use Explanation Metadata in endpoint deployment and model upload: aiplatform.Model.upload(..., explanation_metadata=explanation_metadata) + Cloud Profiler ---------------------------- diff --git a/gemini_docs/README.md b/gemini_docs/README.md index 828bfc84f2..2dc41fd80c 100644 --- a/gemini_docs/README.md +++ b/gemini_docs/README.md @@ -1,6 +1,7 @@ # Vertex Generative AI SDK for Python The Vertex Generative AI SDK helps developers use Google's generative AI [Gemini models](http://cloud.google.com/vertex-ai/docs/generative-ai/multimodal/overview) +and [PaLM language models](http://cloud.google.com/vertex-ai/docs/generative-ai/language-model-overview) to build AI-powered features and applications. The SDKs support use cases like the following: @@ -24,13 +25,7 @@ For detailed instructions, see [quickstart](http://cloud.google.com/vertex-ai/do #### Imports: ```python -import vertexai -``` - -#### Initialization: - -```python -vertexai.init(project='my-project', location='us-central1') +from vertexai.generative_models import GenerativeModel, Image, Content, Part, Tool, FunctionDeclaration, GenerationConfig ``` #### Basic generation: @@ -59,7 +54,7 @@ print(vision_model.generate_content(["What is in the video? ", video_part])) ``` #### Chat -```python +``` from vertexai.generative_models import GenerativeModel, Image vision_model = GenerativeModel("gemini-ultra-vision") vision_chat = vision_model.start_chat() @@ -69,7 +64,7 @@ print(vision_chat.send_message("What things do I like?.")) ``` #### System instructions -```python +``` from vertexai.generative_models import GenerativeModel model = GenerativeModel( "gemini-1.0-pro", @@ -83,7 +78,7 @@ print(model.generate_content("Why is sky blue?")) #### Function calling -```python +``` # First, create tools that the model is can use to answer your questions. # Describe a function by specifying it's schema (JsonSchema format) get_current_weather_func = generative_models.FunctionDeclaration( @@ -137,7 +132,7 @@ print(chat.send_message( #### Automatic Function calling -```python +``` from vertexai.preview.generative_models import GenerativeModel, Tool, FunctionDeclaration, AutomaticFunctionCallingResponder # First, create functions that the model can use to answer your questions. @@ -184,7 +179,7 @@ print(chat.send_message("What is the weather like in Boston?")) - To perform bring-your-own-response(BYOR) evaluation, provide the model responses in the `response` column in the dataset. If a pairwise metric is used for BYOR evaluation, provide the baseline model responses in the `baseline_model_response` column. -```python +``` import pandas as pd from vertexai.evaluation import EvalTask, MetricPromptTemplateExamples @@ -208,7 +203,7 @@ eval_result = eval_task.evaluate(experiment_run_name="eval-experiment-run") ``` - To perform evaluation with Gemini model inference, specify the `model` parameter with a `GenerativeModel` instance. The input column name to the model is `prompt` and must be present in the dataset. -```python +``` from vertexai.evaluation import EvalTask from vertexai.generative_models import GenerativeModel @@ -228,7 +223,7 @@ result = EvalTask( - If a `prompt_template` is specified, the `prompt` column is not required. Prompts can be assembled from the evaluation dataset, and all prompt template variable names must be present in the dataset columns. -```python +``` import pandas as pd from vertexai.evaluation import EvalTask, MetricPromptTemplateExamples from vertexai.generative_models import GenerativeModel @@ -250,7 +245,7 @@ result = EvalTask( parameter with a custom inference function. The input column name to the custom inference function is `prompt` and must be present in the dataset. -```python +``` from openai import OpenAI from vertexai.evaluation import EvalTask, MetricPromptTemplateExamples @@ -284,7 +279,7 @@ the `baseline_model` input to a `PairwiseMetric` instance and the candidate `model` input to the `EvalTask.evaluate()` function. The input column name to both models is `prompt` and must be present in the dataset. -```python +``` import pandas as pd from vertexai.evaluation import EvalTask, MetricPromptTemplateExamples, PairwiseMetric from vertexai.generative_models import GenerativeModel diff --git a/google/cloud/aiplatform/gapic_version.py b/google/cloud/aiplatform/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/gapic_version.py +++ b/google/cloud/aiplatform/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/tensorboard/uploader.py b/google/cloud/aiplatform/tensorboard/uploader.py index b77a176004..c24455ae5e 100644 --- a/google/cloud/aiplatform/tensorboard/uploader.py +++ b/google/cloud/aiplatform/tensorboard/uploader.py @@ -386,7 +386,6 @@ def _pre_create_runs_and_time_series(self): if (run_name and run_name != ".") else uploader_utils.DEFAULT_RUN_NAME ) - run_name = uploader_utils.reformat_run_name(run_name) run_names.append(run_name) for event in events: _filter_graph_defs(event) diff --git a/google/cloud/aiplatform/v1/schema/predict/instance/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/instance/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1/schema/predict/instance/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/instance/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/predict/instance_v1/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/instance_v1/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1/schema/predict/instance_v1/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/instance_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/predict/params/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/params/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1/schema/predict/params/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/params/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/predict/params_v1/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/params_v1/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1/schema/predict/params_v1/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/params_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/predict/prediction/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/prediction/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1/schema/predict/prediction/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/prediction/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/trainingjob/definition/gapic_version.py b/google/cloud/aiplatform/v1/schema/trainingjob/definition/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1/schema/trainingjob/definition/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/trainingjob/definition/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/gapic_version.py b/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/instance/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/instance/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/instance/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/instance/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/instance_v1beta1/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/instance_v1beta1/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/instance_v1beta1/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/instance_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/params/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/params/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/params/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/params/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/params_v1beta1/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/params_v1beta1/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/params_v1beta1/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/params_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/prediction/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/prediction/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/prediction/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/prediction/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition_v1beta1/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition_v1beta1/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition_v1beta1/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/version.py b/google/cloud/aiplatform/version.py index 7b30ae65bb..696fd29b9c 100644 --- a/google/cloud/aiplatform/version.py +++ b/google/cloud/aiplatform/version.py @@ -15,4 +15,4 @@ # limitations under the License. # -__version__ = "1.67.1" +__version__ = "1.66.0" diff --git a/google/cloud/aiplatform_v1/__init__.py b/google/cloud/aiplatform_v1/__init__.py index 25d488a51a..033063ce65 100644 --- a/google/cloud/aiplatform_v1/__init__.py +++ b/google/cloud/aiplatform_v1/__init__.py @@ -101,7 +101,6 @@ from .types.content import GroundingChunk from .types.content import GroundingMetadata from .types.content import GroundingSupport -from .types.content import LogprobsResult from .types.content import Part from .types.content import SafetyRating from .types.content import SafetySetting @@ -1424,7 +1423,6 @@ "ListTuningJobsRequest", "ListTuningJobsResponse", "LlmUtilityServiceClient", - "LogprobsResult", "LookupStudyRequest", "MachineSpec", "ManualBatchTuningParameters", diff --git a/google/cloud/aiplatform_v1/gapic_version.py b/google/cloud/aiplatform_v1/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform_v1/gapic_version.py +++ b/google/cloud/aiplatform_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform_v1/types/__init__.py b/google/cloud/aiplatform_v1/types/__init__.py index 1b0b07ba17..7dd320b3ae 100644 --- a/google/cloud/aiplatform_v1/types/__init__.py +++ b/google/cloud/aiplatform_v1/types/__init__.py @@ -42,7 +42,6 @@ GroundingChunk, GroundingMetadata, GroundingSupport, - LogprobsResult, Part, SafetyRating, SafetySetting, @@ -1061,7 +1060,6 @@ "GroundingChunk", "GroundingMetadata", "GroundingSupport", - "LogprobsResult", "Part", "SafetyRating", "SafetySetting", diff --git a/google/cloud/aiplatform_v1/types/content.py b/google/cloud/aiplatform_v1/types/content.py index 8045aaf393..a4f481577e 100644 --- a/google/cloud/aiplatform_v1/types/content.py +++ b/google/cloud/aiplatform_v1/types/content.py @@ -40,7 +40,6 @@ "CitationMetadata", "Citation", "Candidate", - "LogprobsResult", "Segment", "GroundingChunk", "GroundingSupport", @@ -65,15 +64,12 @@ class HarmCategory(proto.Enum): HARM_CATEGORY_SEXUALLY_EXPLICIT (4): The harm category is sexually explicit content. - HARM_CATEGORY_CIVIC_INTEGRITY (5): - The harm category is civic integrity. """ HARM_CATEGORY_UNSPECIFIED = 0 HARM_CATEGORY_HATE_SPEECH = 1 HARM_CATEGORY_DANGEROUS_CONTENT = 2 HARM_CATEGORY_HARASSMENT = 3 HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 - HARM_CATEGORY_CIVIC_INTEGRITY = 5 class Content(proto.Message): @@ -298,15 +294,6 @@ class GenerationConfig(proto.Message): This field is a member of `oneof`_ ``_max_output_tokens``. stop_sequences (MutableSequence[str]): Optional. Stop sequences. - response_logprobs (bool): - Optional. If true, export the logprobs - results in response. - - This field is a member of `oneof`_ ``_response_logprobs``. - logprobs (int): - Optional. Logit probabilities. - - This field is a member of `oneof`_ ``_logprobs``. presence_penalty (float): Optional. Positive penalties. @@ -470,16 +457,6 @@ class ManualRoutingMode(proto.Message): proto.STRING, number=6, ) - response_logprobs: bool = proto.Field( - proto.BOOL, - number=18, - optional=True, - ) - logprobs: int = proto.Field( - proto.INT32, - number=7, - optional=True, - ) presence_penalty: float = proto.Field( proto.FLOAT, number=8, @@ -757,9 +734,6 @@ class Candidate(proto.Message): avg_logprobs (float): Output only. Average log probability score of the candidate. - logprobs_result (google.cloud.aiplatform_v1.types.LogprobsResult): - Output only. Log-likelihood scores for the - response tokens and top tokens finish_reason (google.cloud.aiplatform_v1.types.Candidate.FinishReason): Output only. The reason why the model stopped generating tokens. If empty, the model has not @@ -848,11 +822,6 @@ class FinishReason(proto.Enum): proto.DOUBLE, number=9, ) - logprobs_result: "LogprobsResult" = proto.Field( - proto.MESSAGE, - number=10, - message="LogprobsResult", - ) finish_reason: FinishReason = proto.Field( proto.ENUM, number=3, @@ -880,80 +849,6 @@ class FinishReason(proto.Enum): ) -class LogprobsResult(proto.Message): - r"""Logprobs Result - - Attributes: - top_candidates (MutableSequence[google.cloud.aiplatform_v1.types.LogprobsResult.TopCandidates]): - Length = total number of decoding steps. - chosen_candidates (MutableSequence[google.cloud.aiplatform_v1.types.LogprobsResult.Candidate]): - Length = total number of decoding steps. The chosen - candidates may or may not be in top_candidates. - """ - - class Candidate(proto.Message): - r"""Candidate for the logprobs token and score. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - token (str): - The candidate’s token string value. - - This field is a member of `oneof`_ ``_token``. - token_id (int): - The candidate’s token id value. - - This field is a member of `oneof`_ ``_token_id``. - log_probability (float): - The candidate's log probability. - - This field is a member of `oneof`_ ``_log_probability``. - """ - - token: str = proto.Field( - proto.STRING, - number=1, - optional=True, - ) - token_id: int = proto.Field( - proto.INT32, - number=3, - optional=True, - ) - log_probability: float = proto.Field( - proto.FLOAT, - number=2, - optional=True, - ) - - class TopCandidates(proto.Message): - r"""Candidates with top log probabilities at each decoding step. - - Attributes: - candidates (MutableSequence[google.cloud.aiplatform_v1.types.LogprobsResult.Candidate]): - Sorted by log probability in descending - order. - """ - - candidates: MutableSequence["LogprobsResult.Candidate"] = proto.RepeatedField( - proto.MESSAGE, - number=1, - message="LogprobsResult.Candidate", - ) - - top_candidates: MutableSequence[TopCandidates] = proto.RepeatedField( - proto.MESSAGE, - number=1, - message=TopCandidates, - ) - chosen_candidates: MutableSequence[Candidate] = proto.RepeatedField( - proto.MESSAGE, - number=2, - message=Candidate, - ) - - class Segment(proto.Message): r"""Segment of the content. diff --git a/google/cloud/aiplatform_v1/types/openapi.py b/google/cloud/aiplatform_v1/types/openapi.py index 4372670391..a8a018c982 100644 --- a/google/cloud/aiplatform_v1/types/openapi.py +++ b/google/cloud/aiplatform_v1/types/openapi.py @@ -131,10 +131,6 @@ class Schema(proto.Message): example (google.protobuf.struct_pb2.Value): Optional. Example of the object. Will only populated when the object is the root. - any_of (MutableSequence[google.cloud.aiplatform_v1.types.Schema]): - Optional. The value should be validated - against any (one or more) of the subschemas in - the list. """ type_: "Type" = proto.Field( @@ -227,11 +223,6 @@ class Schema(proto.Message): number=4, message=struct_pb2.Value, ) - any_of: MutableSequence["Schema"] = proto.RepeatedField( - proto.MESSAGE, - number=11, - message="Schema", - ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1/types/prediction_service.py b/google/cloud/aiplatform_v1/types/prediction_service.py index d57e4de92e..fb4de9f4c0 100644 --- a/google/cloud/aiplatform_v1/types/prediction_service.py +++ b/google/cloud/aiplatform_v1/types/prediction_service.py @@ -709,11 +709,6 @@ class CountTokensRequest(proto.Message): A ``Tool`` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. - generation_config (google.cloud.aiplatform_v1.types.GenerationConfig): - Optional. Generation config that the model - will use to generate the response. - - This field is a member of `oneof`_ ``_generation_config``. """ endpoint: str = proto.Field( @@ -745,12 +740,6 @@ class CountTokensRequest(proto.Message): number=6, message=tool.Tool, ) - generation_config: content.GenerationConfig = proto.Field( - proto.MESSAGE, - number=7, - optional=True, - message=content.GenerationConfig, - ) class CountTokensResponse(proto.Message): @@ -814,17 +803,6 @@ class GenerateContentRequest(proto.Message): tool_config (google.cloud.aiplatform_v1.types.ToolConfig): Optional. Tool config. This config is shared for all tools provided in the request. - labels (MutableMapping[str, str]): - Optional. The labels with user-defined - metadata for the request. It is used for billing - and reporting only. - - Label keys and values can be no longer than 63 - characters (Unicode codepoints) and can only - contain lowercase letters, numeric characters, - underscores, and dashes. International - characters are allowed. Label values are - optional. Label keys must start with a letter. safety_settings (MutableSequence[google.cloud.aiplatform_v1.types.SafetySetting]): Optional. Per request settings for blocking unsafe content. Enforced on @@ -858,11 +836,6 @@ class GenerateContentRequest(proto.Message): number=7, message=tool.ToolConfig, ) - labels: MutableMapping[str, str] = proto.MapField( - proto.STRING, - proto.STRING, - number=10, - ) safety_settings: MutableSequence[content.SafetySetting] = proto.RepeatedField( proto.MESSAGE, number=3, @@ -881,9 +854,6 @@ class GenerateContentResponse(proto.Message): Attributes: candidates (MutableSequence[google.cloud.aiplatform_v1.types.Candidate]): Output only. Generated candidates. - model_version (str): - Output only. The model version used to - generate the response. prompt_feedback (google.cloud.aiplatform_v1.types.GenerateContentResponse.PromptFeedback): Output only. Content filter results for a prompt sent in the request. Note: Sent only in @@ -956,8 +926,7 @@ class UsageMetadata(proto.Message): candidates_token_count (int): Number of tokens in the response(s). total_token_count (int): - Total token count for prompt and response - candidates. + """ prompt_token_count: int = proto.Field( @@ -978,10 +947,6 @@ class UsageMetadata(proto.Message): number=2, message=content.Candidate, ) - model_version: str = proto.Field( - proto.STRING, - number=11, - ) prompt_feedback: PromptFeedback = proto.Field( proto.MESSAGE, number=3, diff --git a/google/cloud/aiplatform_v1beta1/__init__.py b/google/cloud/aiplatform_v1beta1/__init__.py index 1a05a7867d..1ee81a1e9b 100644 --- a/google/cloud/aiplatform_v1beta1/__init__.py +++ b/google/cloud/aiplatform_v1beta1/__init__.py @@ -123,7 +123,6 @@ from .types.content import GroundingChunk from .types.content import GroundingMetadata from .types.content import GroundingSupport -from .types.content import LogprobsResult from .types.content import Part from .types.content import SafetyRating from .types.content import SafetySetting @@ -823,7 +822,6 @@ from .types.pipeline_job import PipelineJobDetail from .types.pipeline_job import PipelineTaskDetail from .types.pipeline_job import PipelineTaskExecutorDetail -from .types.pipeline_job import PipelineTaskRerunConfig from .types.pipeline_job import PipelineTemplateMetadata from .types.pipeline_service import BatchCancelPipelineJobsOperationMetadata from .types.pipeline_service import BatchCancelPipelineJobsRequest @@ -895,7 +893,6 @@ from .types.schedule_service import UpdateScheduleRequest from .types.service_networking import PrivateServiceConnectConfig from .types.service_networking import PscAutomatedEndpoints -from .types.service_networking import PSCAutomationConfig from .types.service_networking import PscInterfaceConfig from .types.specialist_pool import SpecialistPool from .types.specialist_pool_service import CreateSpecialistPoolOperationMetadata @@ -1003,8 +1000,6 @@ from .types.types import Int64Array from .types.types import StringArray from .types.types import Tensor -from .types.ui_pipeline_spec import ArtifactTypeSchema -from .types.ui_pipeline_spec import RuntimeArtifact from .types.unmanaged_container_model import UnmanagedContainerModel from .types.user_action_reference import UserActionReference from .types.value import Value @@ -1111,7 +1106,6 @@ "AnnotationSpec", "ApiAuth", "Artifact", - "ArtifactTypeSchema", "AssignNotebookRuntimeOperationMetadata", "AssignNotebookRuntimeRequest", "Attribution", @@ -1650,7 +1644,6 @@ "ListTuningJobsRequest", "ListTuningJobsResponse", "LlmUtilityServiceClient", - "LogprobsResult", "LookupStudyRequest", "MachineSpec", "ManualBatchTuningParameters", @@ -1724,7 +1717,6 @@ "NotebookRuntimeTemplateRef", "NotebookRuntimeType", "NotebookServiceClient", - "PSCAutomationConfig", "PairwiseChoice", "PairwiseMetricInput", "PairwiseMetricInstance", @@ -1751,7 +1743,6 @@ "PipelineState", "PipelineTaskDetail", "PipelineTaskExecutorDetail", - "PipelineTaskRerunConfig", "PipelineTemplateMetadata", "PointwiseMetricInput", "PointwiseMetricInstance", @@ -1860,7 +1851,6 @@ "RougeMetricValue", "RougeResults", "RougeSpec", - "RuntimeArtifact", "RuntimeConfig", "SafetyInput", "SafetyInstance", diff --git a/google/cloud/aiplatform_v1beta1/gapic_version.py b/google/cloud/aiplatform_v1beta1/gapic_version.py index 69071254a8..6f0a1f23ad 100644 --- a/google/cloud/aiplatform_v1beta1/gapic_version.py +++ b/google/cloud/aiplatform_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.67.1" # {x-release-please-version} +__version__ = "1.66.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py index 0e54d13c2c..ba3323f393 100644 --- a/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py @@ -1752,15 +1752,10 @@ async def sample_generate_content(): request (Optional[Union[google.cloud.aiplatform_v1beta1.types.GenerateContentRequest, dict]]): The request object. Request message for [PredictionService.GenerateContent]. model (:class:`str`): - Required. The fully qualified name of the publisher - model or tuned model endpoint to use. - - Publisher model format: + Required. The name of the publisher model requested to + serve the prediction. Format: ``projects/{project}/locations/{location}/publishers/*/models/*`` - Tuned model endpoint format: - ``projects/{project}/locations/{location}/endpoints/{endpoint}`` - This corresponds to the ``model`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1885,15 +1880,10 @@ async def sample_stream_generate_content(): request (Optional[Union[google.cloud.aiplatform_v1beta1.types.GenerateContentRequest, dict]]): The request object. Request message for [PredictionService.GenerateContent]. model (:class:`str`): - Required. The fully qualified name of the publisher - model or tuned model endpoint to use. - - Publisher model format: + Required. The name of the publisher model requested to + serve the prediction. Format: ``projects/{project}/locations/{location}/publishers/*/models/*`` - Tuned model endpoint format: - ``projects/{project}/locations/{location}/endpoints/{endpoint}`` - This corresponds to the ``model`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2014,9 +2004,9 @@ async def sample_chat_completions(): request (Optional[Union[google.cloud.aiplatform_v1beta1.types.ChatCompletionsRequest, dict]]): The request object. Request message for [PredictionService.ChatCompletions] endpoint (:class:`str`): - Required. The name of the endpoint requested to serve + Required. The name of the Endpoint requested to serve the prediction. Format: - ``projects/{project}/locations/{location}/endpoints/{endpoint}`` + ``projects/{project}/locations/{location}/endpoints/openapi`` This corresponds to the ``endpoint`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/aiplatform_v1beta1/services/prediction_service/client.py b/google/cloud/aiplatform_v1beta1/services/prediction_service/client.py index a7f2b7fcdb..3abcecebef 100644 --- a/google/cloud/aiplatform_v1beta1/services/prediction_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/prediction_service/client.py @@ -2207,15 +2207,10 @@ def sample_generate_content(): request (Union[google.cloud.aiplatform_v1beta1.types.GenerateContentRequest, dict]): The request object. Request message for [PredictionService.GenerateContent]. model (str): - Required. The fully qualified name of the publisher - model or tuned model endpoint to use. - - Publisher model format: + Required. The name of the publisher model requested to + serve the prediction. Format: ``projects/{project}/locations/{location}/publishers/*/models/*`` - Tuned model endpoint format: - ``projects/{project}/locations/{location}/endpoints/{endpoint}`` - This corresponds to the ``model`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2337,15 +2332,10 @@ def sample_stream_generate_content(): request (Union[google.cloud.aiplatform_v1beta1.types.GenerateContentRequest, dict]): The request object. Request message for [PredictionService.GenerateContent]. model (str): - Required. The fully qualified name of the publisher - model or tuned model endpoint to use. - - Publisher model format: + Required. The name of the publisher model requested to + serve the prediction. Format: ``projects/{project}/locations/{location}/publishers/*/models/*`` - Tuned model endpoint format: - ``projects/{project}/locations/{location}/endpoints/{endpoint}`` - This corresponds to the ``model`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2463,9 +2453,9 @@ def sample_chat_completions(): request (Union[google.cloud.aiplatform_v1beta1.types.ChatCompletionsRequest, dict]): The request object. Request message for [PredictionService.ChatCompletions] endpoint (str): - Required. The name of the endpoint requested to serve + Required. The name of the Endpoint requested to serve the prediction. Format: - ``projects/{project}/locations/{location}/endpoints/{endpoint}`` + ``projects/{project}/locations/{location}/endpoints/openapi`` This corresponds to the ``endpoint`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/aiplatform_v1beta1/types/__init__.py b/google/cloud/aiplatform_v1beta1/types/__init__.py index 08ce598d35..92b8a80bb4 100644 --- a/google/cloud/aiplatform_v1beta1/types/__init__.py +++ b/google/cloud/aiplatform_v1beta1/types/__init__.py @@ -48,7 +48,6 @@ GroundingChunk, GroundingMetadata, GroundingSupport, - LogprobsResult, Part, SafetyRating, SafetySetting, @@ -904,7 +903,6 @@ PipelineJobDetail, PipelineTaskDetail, PipelineTaskExecutorDetail, - PipelineTaskRerunConfig, PipelineTemplateMetadata, ) from .pipeline_service import ( @@ -1000,7 +998,6 @@ from .service_networking import ( PrivateServiceConnectConfig, PscAutomatedEndpoints, - PSCAutomationConfig, PscInterfaceConfig, ) from .specialist_pool import ( @@ -1135,10 +1132,6 @@ StringArray, Tensor, ) -from .ui_pipeline_spec import ( - ArtifactTypeSchema, - RuntimeArtifact, -) from .unmanaged_container_model import ( UnmanagedContainerModel, ) @@ -1229,7 +1222,6 @@ "GroundingChunk", "GroundingMetadata", "GroundingSupport", - "LogprobsResult", "Part", "SafetyRating", "SafetySetting", @@ -1913,7 +1905,6 @@ "PipelineJobDetail", "PipelineTaskDetail", "PipelineTaskExecutorDetail", - "PipelineTaskRerunConfig", "PipelineTemplateMetadata", "BatchCancelPipelineJobsOperationMetadata", "BatchCancelPipelineJobsRequest", @@ -1985,7 +1976,6 @@ "UpdateScheduleRequest", "PrivateServiceConnectConfig", "PscAutomatedEndpoints", - "PSCAutomationConfig", "PscInterfaceConfig", "SpecialistPool", "CreateSpecialistPoolOperationMetadata", @@ -2093,8 +2083,6 @@ "Int64Array", "StringArray", "Tensor", - "ArtifactTypeSchema", - "RuntimeArtifact", "UnmanagedContainerModel", "UserActionReference", "Value", diff --git a/google/cloud/aiplatform_v1beta1/types/content.py b/google/cloud/aiplatform_v1beta1/types/content.py index 3f6b68aee5..b6cb876fd0 100644 --- a/google/cloud/aiplatform_v1beta1/types/content.py +++ b/google/cloud/aiplatform_v1beta1/types/content.py @@ -40,7 +40,6 @@ "CitationMetadata", "Citation", "Candidate", - "LogprobsResult", "Segment", "GroundingChunk", "GroundingSupport", @@ -65,15 +64,12 @@ class HarmCategory(proto.Enum): HARM_CATEGORY_SEXUALLY_EXPLICIT (4): The harm category is sexually explicit content. - HARM_CATEGORY_CIVIC_INTEGRITY (5): - The harm category is civic integrity. """ HARM_CATEGORY_UNSPECIFIED = 0 HARM_CATEGORY_HATE_SPEECH = 1 HARM_CATEGORY_DANGEROUS_CONTENT = 2 HARM_CATEGORY_HARASSMENT = 3 HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 - HARM_CATEGORY_CIVIC_INTEGRITY = 5 class Content(proto.Message): @@ -298,15 +294,6 @@ class GenerationConfig(proto.Message): This field is a member of `oneof`_ ``_max_output_tokens``. stop_sequences (MutableSequence[str]): Optional. Stop sequences. - response_logprobs (bool): - Optional. If true, export the logprobs - results in response. - - This field is a member of `oneof`_ ``_response_logprobs``. - logprobs (int): - Optional. Logit probabilities. - - This field is a member of `oneof`_ ``_logprobs``. presence_penalty (float): Optional. Positive penalties. @@ -470,16 +457,6 @@ class ManualRoutingMode(proto.Message): proto.STRING, number=6, ) - response_logprobs: bool = proto.Field( - proto.BOOL, - number=18, - optional=True, - ) - logprobs: int = proto.Field( - proto.INT32, - number=7, - optional=True, - ) presence_penalty: float = proto.Field( proto.FLOAT, number=8, @@ -754,9 +731,6 @@ class Candidate(proto.Message): avg_logprobs (float): Output only. Average log probability score of the candidate. - logprobs_result (google.cloud.aiplatform_v1beta1.types.LogprobsResult): - Output only. Log-likelihood scores for the - response tokens and top tokens finish_reason (google.cloud.aiplatform_v1beta1.types.Candidate.FinishReason): Output only. The reason why the model stopped generating tokens. If empty, the model has not @@ -841,11 +815,6 @@ class FinishReason(proto.Enum): proto.DOUBLE, number=9, ) - logprobs_result: "LogprobsResult" = proto.Field( - proto.MESSAGE, - number=10, - message="LogprobsResult", - ) finish_reason: FinishReason = proto.Field( proto.ENUM, number=3, @@ -873,80 +842,6 @@ class FinishReason(proto.Enum): ) -class LogprobsResult(proto.Message): - r"""Logprobs Result - - Attributes: - top_candidates (MutableSequence[google.cloud.aiplatform_v1beta1.types.LogprobsResult.TopCandidates]): - Length = total number of decoding steps. - chosen_candidates (MutableSequence[google.cloud.aiplatform_v1beta1.types.LogprobsResult.Candidate]): - Length = total number of decoding steps. The chosen - candidates may or may not be in top_candidates. - """ - - class Candidate(proto.Message): - r"""Candidate for the logprobs token and score. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - token (str): - The candidate’s token string value. - - This field is a member of `oneof`_ ``_token``. - token_id (int): - The candidate’s token id value. - - This field is a member of `oneof`_ ``_token_id``. - log_probability (float): - The candidate's log probability. - - This field is a member of `oneof`_ ``_log_probability``. - """ - - token: str = proto.Field( - proto.STRING, - number=1, - optional=True, - ) - token_id: int = proto.Field( - proto.INT32, - number=3, - optional=True, - ) - log_probability: float = proto.Field( - proto.FLOAT, - number=2, - optional=True, - ) - - class TopCandidates(proto.Message): - r"""Candidates with top log probabilities at each decoding step. - - Attributes: - candidates (MutableSequence[google.cloud.aiplatform_v1beta1.types.LogprobsResult.Candidate]): - Sorted by log probability in descending - order. - """ - - candidates: MutableSequence["LogprobsResult.Candidate"] = proto.RepeatedField( - proto.MESSAGE, - number=1, - message="LogprobsResult.Candidate", - ) - - top_candidates: MutableSequence[TopCandidates] = proto.RepeatedField( - proto.MESSAGE, - number=1, - message=TopCandidates, - ) - chosen_candidates: MutableSequence[Candidate] = proto.RepeatedField( - proto.MESSAGE, - number=2, - message=Candidate, - ) - - class Segment(proto.Message): r"""Segment of the content. diff --git a/google/cloud/aiplatform_v1beta1/types/index_endpoint.py b/google/cloud/aiplatform_v1beta1/types/index_endpoint.py index 89d91a6789..ebed5dd179 100644 --- a/google/cloud/aiplatform_v1beta1/types/index_endpoint.py +++ b/google/cloud/aiplatform_v1beta1/types/index_endpoint.py @@ -327,11 +327,6 @@ class DeployedIndex(proto.Message): Note: we only support up to 5 deployment groups(not including 'default'). - psc_automation_configs (MutableSequence[google.cloud.aiplatform_v1beta1.types.PSCAutomationConfig]): - Optional. If set for PSC deployed index, PSC connection will - be automatically created after deployment is done and the - endpoint information is populated in - private_endpoints.psc_automated_endpoints. """ id: str = proto.Field( @@ -388,13 +383,6 @@ class DeployedIndex(proto.Message): proto.STRING, number=11, ) - psc_automation_configs: MutableSequence[ - service_networking.PSCAutomationConfig - ] = proto.RepeatedField( - proto.MESSAGE, - number=19, - message=service_networking.PSCAutomationConfig, - ) class DeployedIndexAuthConfig(proto.Message): diff --git a/google/cloud/aiplatform_v1beta1/types/openapi.py b/google/cloud/aiplatform_v1beta1/types/openapi.py index ca9b47319f..51b6ef9787 100644 --- a/google/cloud/aiplatform_v1beta1/types/openapi.py +++ b/google/cloud/aiplatform_v1beta1/types/openapi.py @@ -131,10 +131,6 @@ class Schema(proto.Message): example (google.protobuf.struct_pb2.Value): Optional. Example of the object. Will only populated when the object is the root. - any_of (MutableSequence[google.cloud.aiplatform_v1beta1.types.Schema]): - Optional. The value should be validated - against any (one or more) of the subschemas in - the list. """ type_: "Type" = proto.Field( @@ -227,11 +223,6 @@ class Schema(proto.Message): number=4, message=struct_pb2.Value, ) - any_of: MutableSequence["Schema"] = proto.RepeatedField( - proto.MESSAGE, - number=11, - message="Schema", - ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/pipeline_job.py b/google/cloud/aiplatform_v1beta1/types/pipeline_job.py index 11e4a45bd6..a39e9bdd88 100644 --- a/google/cloud/aiplatform_v1beta1/types/pipeline_job.py +++ b/google/cloud/aiplatform_v1beta1/types/pipeline_job.py @@ -25,7 +25,6 @@ from google.cloud.aiplatform_v1beta1.types import execution as gca_execution from google.cloud.aiplatform_v1beta1.types import pipeline_failure_policy from google.cloud.aiplatform_v1beta1.types import pipeline_state -from google.cloud.aiplatform_v1beta1.types import ui_pipeline_spec from google.cloud.aiplatform_v1beta1.types import value as gca_value from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -40,7 +39,6 @@ "PipelineJobDetail", "PipelineTaskDetail", "PipelineTaskExecutorDetail", - "PipelineTaskRerunConfig", }, ) @@ -156,24 +154,6 @@ class PipelineJob(proto.Message): Output only. Reserved for future use. satisfies_pzi (bool): Output only. Reserved for future use. - original_pipeline_job_id (int): - Output only. The original pipeline job id if - this pipeline job is a rerun of a previous - pipeline job. - pipeline_task_rerun_configs (MutableSequence[google.cloud.aiplatform_v1beta1.types.PipelineTaskRerunConfig]): - Output only. The rerun configs for each task - in the pipeline job. By default, the rerun will: - - 1. Use the same input artifacts as the original - run. - 2. Use the same input parameters as the original - run. - 3. Skip all the tasks that are already succeeded - in the original run. - 4. Rerun all the tasks that are not succeeded in - the original run. By providing this field, - users can override the default behavior and - specify the rerun config for each task. """ class RuntimeConfig(proto.Message): @@ -375,17 +355,6 @@ class InputArtifact(proto.Message): proto.BOOL, number=28, ) - original_pipeline_job_id: int = proto.Field( - proto.INT64, - number=29, - ) - pipeline_task_rerun_configs: MutableSequence[ - "PipelineTaskRerunConfig" - ] = proto.RepeatedField( - proto.MESSAGE, - number=30, - message="PipelineTaskRerunConfig", - ) class PipelineTemplateMetadata(proto.Message): @@ -748,91 +717,4 @@ class CustomJobDetail(proto.Message): ) -class PipelineTaskRerunConfig(proto.Message): - r"""User provided rerun config to submit a rerun pipelinejob. - This includes - 1. Which task to rerun - 2. User override input parameters and artifacts. - - Attributes: - task_id (int): - Output only. The system generated ID of the - task. Retrieved from original run. - task_name (str): - Output only. The name of the task. - inputs (google.cloud.aiplatform_v1beta1.types.PipelineTaskRerunConfig.Inputs): - Output only. The runtime input of the task - overridden by the user. - skip_task (bool): - Output only. Whether to skip this task. - Default value is False. - skip_downstream_tasks (bool): - Output only. Whether to skip downstream - tasks. Default value is False. - """ - - class ArtifactList(proto.Message): - r"""A list of artifact metadata. - - Attributes: - artifacts (MutableSequence[google.cloud.aiplatform_v1beta1.types.RuntimeArtifact]): - Output only. A list of artifact metadata. - """ - - artifacts: MutableSequence[ - ui_pipeline_spec.RuntimeArtifact - ] = proto.RepeatedField( - proto.MESSAGE, - number=1, - message=ui_pipeline_spec.RuntimeArtifact, - ) - - class Inputs(proto.Message): - r"""Runtime inputs data of the task. - - Attributes: - artifacts (MutableMapping[str, google.cloud.aiplatform_v1beta1.types.PipelineTaskRerunConfig.ArtifactList]): - Output only. Input artifacts. - parameter_values (MutableMapping[str, google.protobuf.struct_pb2.Value]): - Output only. Input parameters. - """ - - artifacts: MutableMapping[ - str, "PipelineTaskRerunConfig.ArtifactList" - ] = proto.MapField( - proto.STRING, - proto.MESSAGE, - number=1, - message="PipelineTaskRerunConfig.ArtifactList", - ) - parameter_values: MutableMapping[str, struct_pb2.Value] = proto.MapField( - proto.STRING, - proto.MESSAGE, - number=2, - message=struct_pb2.Value, - ) - - task_id: int = proto.Field( - proto.INT64, - number=1, - ) - task_name: str = proto.Field( - proto.STRING, - number=2, - ) - inputs: Inputs = proto.Field( - proto.MESSAGE, - number=3, - message=Inputs, - ) - skip_task: bool = proto.Field( - proto.BOOL, - number=4, - ) - skip_downstream_tasks: bool = proto.Field( - proto.BOOL, - number=5, - ) - - __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/prediction_service.py b/google/cloud/aiplatform_v1beta1/types/prediction_service.py index b90ae91873..8aa2e75ecd 100644 --- a/google/cloud/aiplatform_v1beta1/types/prediction_service.py +++ b/google/cloud/aiplatform_v1beta1/types/prediction_service.py @@ -765,11 +765,6 @@ class CountTokensRequest(proto.Message): A ``Tool`` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. - generation_config (google.cloud.aiplatform_v1beta1.types.GenerationConfig): - Optional. Generation config that the model - will use to generate the response. - - This field is a member of `oneof`_ ``_generation_config``. """ endpoint: str = proto.Field( @@ -801,12 +796,6 @@ class CountTokensRequest(proto.Message): number=6, message=tool.Tool, ) - generation_config: content.GenerationConfig = proto.Field( - proto.MESSAGE, - number=7, - optional=True, - message=content.GenerationConfig, - ) class CountTokensResponse(proto.Message): @@ -839,14 +828,9 @@ class GenerateContentRequest(proto.Message): Attributes: model (str): - Required. The fully qualified name of the publisher model or - tuned model endpoint to use. - - Publisher model format: + Required. The name of the publisher model requested to serve + the prediction. Format: ``projects/{project}/locations/{location}/publishers/*/models/*`` - - Tuned model endpoint format: - ``projects/{project}/locations/{location}/endpoints/{endpoint}`` contents (MutableSequence[google.cloud.aiplatform_v1beta1.types.Content]): Required. The content of the current conversation with the model. @@ -877,17 +861,6 @@ class GenerateContentRequest(proto.Message): tool_config (google.cloud.aiplatform_v1beta1.types.ToolConfig): Optional. Tool config. This config is shared for all tools provided in the request. - labels (MutableMapping[str, str]): - Optional. The labels with user-defined - metadata for the request. It is used for billing - and reporting only. - - Label keys and values can be no longer than 63 - characters (Unicode codepoints) and can only - contain lowercase letters, numeric characters, - underscores, and dashes. International - characters are allowed. Label values are - optional. Label keys must start with a letter. safety_settings (MutableSequence[google.cloud.aiplatform_v1beta1.types.SafetySetting]): Optional. Per request settings for blocking unsafe content. Enforced on @@ -925,11 +898,6 @@ class GenerateContentRequest(proto.Message): number=7, message=tool.ToolConfig, ) - labels: MutableMapping[str, str] = proto.MapField( - proto.STRING, - proto.STRING, - number=10, - ) safety_settings: MutableSequence[content.SafetySetting] = proto.RepeatedField( proto.MESSAGE, number=3, @@ -948,9 +916,6 @@ class GenerateContentResponse(proto.Message): Attributes: candidates (MutableSequence[google.cloud.aiplatform_v1beta1.types.Candidate]): Output only. Generated candidates. - model_version (str): - Output only. The model version used to - generate the response. prompt_feedback (google.cloud.aiplatform_v1beta1.types.GenerateContentResponse.PromptFeedback): Output only. Content filter results for a prompt sent in the request. Note: Sent only in @@ -1023,8 +988,7 @@ class UsageMetadata(proto.Message): candidates_token_count (int): Number of tokens in the response(s). total_token_count (int): - Total token count for prompt and response - candidates. + cached_content_token_count (int): Output only. Number of tokens in the cached part in the input (the cached content). @@ -1052,10 +1016,6 @@ class UsageMetadata(proto.Message): number=2, message=content.Candidate, ) - model_version: str = proto.Field( - proto.STRING, - number=11, - ) prompt_feedback: PromptFeedback = proto.Field( proto.MESSAGE, number=3, @@ -1073,9 +1033,9 @@ class ChatCompletionsRequest(proto.Message): Attributes: endpoint (str): - Required. The name of the endpoint requested to serve the + Required. The name of the Endpoint requested to serve the prediction. Format: - ``projects/{project}/locations/{location}/endpoints/{endpoint}`` + ``projects/{project}/locations/{location}/endpoints/openapi`` http_body (google.api.httpbody_pb2.HttpBody): Optional. The prediction input. Supports HTTP headers and arbitrary data payload. diff --git a/google/cloud/aiplatform_v1beta1/types/service_networking.py b/google/cloud/aiplatform_v1beta1/types/service_networking.py index 3a9b57420c..4e094c1470 100644 --- a/google/cloud/aiplatform_v1beta1/types/service_networking.py +++ b/google/cloud/aiplatform_v1beta1/types/service_networking.py @@ -23,7 +23,6 @@ __protobuf__ = proto.module( package="google.cloud.aiplatform.v1beta1", manifest={ - "PSCAutomationConfig", "PrivateServiceConnectConfig", "PscAutomatedEndpoints", "PscInterfaceConfig", @@ -31,33 +30,6 @@ ) -class PSCAutomationConfig(proto.Message): - r"""PSC config that is used to automatically create forwarding - rule via ServiceConnectionMap. - - Attributes: - project_id (str): - Required. Project id used to create - forwarding rule. - network (str): - Required. The full name of the Google Compute Engine - `network `__. - `Format `__: - ``projects/{project}/global/networks/{network}``. Where - {project} is a project number, as in '12345', and {network} - is network name. - """ - - project_id: str = proto.Field( - proto.STRING, - number=1, - ) - network: str = proto.Field( - proto.STRING, - number=2, - ) - - class PrivateServiceConnectConfig(proto.Message): r"""Represents configuration for private service connect. diff --git a/google/cloud/aiplatform_v1beta1/types/ui_pipeline_spec.py b/google/cloud/aiplatform_v1beta1/types/ui_pipeline_spec.py deleted file mode 100644 index 5c43d9f9a2..0000000000 --- a/google/cloud/aiplatform_v1beta1/types/ui_pipeline_spec.py +++ /dev/null @@ -1,148 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 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 __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.cloud.aiplatform_v1beta1.types import value as gca_value -from google.protobuf import struct_pb2 # type: ignore - - -__protobuf__ = proto.module( - package="google.cloud.aiplatform.v1beta1", - manifest={ - "ArtifactTypeSchema", - "RuntimeArtifact", - }, -) - - -class ArtifactTypeSchema(proto.Message): - r"""The definition of a artifact type in MLMD. - - 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: - schema_title (str): - The name of the type. The format of the title must be: - ``.``. Examples: - - - ``aiplatform.Model`` - - ``acme.CustomModel`` When this field is set, the type - must be pre-registered in the MLMD store. - - This field is a member of `oneof`_ ``kind``. - schema_uri (str): - Points to a YAML file stored on Cloud Storage describing the - format. Deprecated. Use - [PipelineArtifactTypeSchema.schema_title][] or - [PipelineArtifactTypeSchema.instance_schema][] instead. - - This field is a member of `oneof`_ ``kind``. - instance_schema (str): - Contains a raw YAML string, describing the - format of the properties of the type. - - This field is a member of `oneof`_ ``kind``. - schema_version (str): - The schema version of the artifact. If the - value is not set, it defaults to the latest - version in the system. - """ - - schema_title: str = proto.Field( - proto.STRING, - number=1, - oneof="kind", - ) - schema_uri: str = proto.Field( - proto.STRING, - number=2, - oneof="kind", - ) - instance_schema: str = proto.Field( - proto.STRING, - number=3, - oneof="kind", - ) - schema_version: str = proto.Field( - proto.STRING, - number=4, - ) - - -class RuntimeArtifact(proto.Message): - r"""The definition of a runtime artifact. - - Attributes: - name (str): - The name of an artifact. - type_ (google.cloud.aiplatform_v1beta1.types.ArtifactTypeSchema): - The type of the artifact. - uri (str): - The URI of the artifact. - properties (MutableMapping[str, google.cloud.aiplatform_v1beta1.types.Value]): - The properties of the artifact. Deprecated. Use - [RuntimeArtifact.metadata][google.cloud.aiplatform.v1beta1.RuntimeArtifact.metadata] - instead. - custom_properties (MutableMapping[str, google.cloud.aiplatform_v1beta1.types.Value]): - The custom properties of the artifact. Deprecated. Use - [RuntimeArtifact.metadata][google.cloud.aiplatform.v1beta1.RuntimeArtifact.metadata] - instead. - metadata (google.protobuf.struct_pb2.Struct): - Properties of the Artifact. - """ - - name: str = proto.Field( - proto.STRING, - number=1, - ) - type_: "ArtifactTypeSchema" = proto.Field( - proto.MESSAGE, - number=2, - message="ArtifactTypeSchema", - ) - uri: str = proto.Field( - proto.STRING, - number=3, - ) - properties: MutableMapping[str, gca_value.Value] = proto.MapField( - proto.STRING, - proto.MESSAGE, - number=4, - message=gca_value.Value, - ) - custom_properties: MutableMapping[str, gca_value.Value] = proto.MapField( - proto.STRING, - proto.MESSAGE, - number=5, - message=gca_value.Value, - ) - metadata: struct_pb2.Struct = proto.Field( - proto.MESSAGE, - number=6, - message=struct_pb2.Struct, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/pypi/_vertex_ai_placeholder/version.py b/pypi/_vertex_ai_placeholder/version.py index 8f02218080..e251e811ab 100644 --- a/pypi/_vertex_ai_placeholder/version.py +++ b/pypi/_vertex_ai_placeholder/version.py @@ -15,4 +15,4 @@ # limitations under the License. # -__version__ = "1.67.1" +__version__ = "1.66.0" diff --git a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json index 73e7446dc0..f5f6625974 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-aiplatform", - "version": "0.1.0" + "version": "1.66.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json index fe605eb31b..b8c672fa99 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-aiplatform", - "version": "0.1.0" + "version": "1.66.0" }, "snippets": [ { diff --git a/setup.py b/setup.py index 637f46580e..d36b383884 100644 --- a/setup.py +++ b/setup.py @@ -110,7 +110,7 @@ " 2.21.*, !=2.22.*, !=2.23.*, !=2.24.*, !=2.25.*, !=2.26.*, !=2.27.*, !=" " 2.28.*, !=2.29.*, !=2.30.*, !=2.31.*, !=2.32.*; python_version<'3.11'" ), - # To avoid ImportError: cannot import name 'packaging' from 'pkg_resources' + # To avoid ImportError: cannot import name 'packaging' from 'pkg)resources' "setuptools < 70.0.0", # Ray Data v2.4 in Python 3.11 is broken, but got fixed in Ray v2.5. "ray[default] >= 2.5, <= 2.33.0; python_version=='3.11'", @@ -118,6 +118,9 @@ "google-cloud-bigquery", "pandas >= 1.0.0, < 2.2.0", "pyarrow >= 6.0.1", + # Workaround for https://github.com/ray-project/ray/issues/36990. + # TODO(b/295406381): Remove this pin when we drop support of ray<=2.5. + "pydantic < 2", "immutabledict", ] diff --git a/tests/system/vertexai/test_generative_models.py b/tests/system/vertexai/test_generative_models.py index f62dbecddf..a7b2ae4a64 100644 --- a/tests/system/vertexai/test_generative_models.py +++ b/tests/system/vertexai/test_generative_models.py @@ -36,7 +36,6 @@ GEMINI_VISION_MODEL_NAME = "gemini-1.0-pro-vision" GEMINI_15_MODEL_NAME = "gemini-1.5-pro-preview-0409" GEMINI_15_PRO_MODEL_NAME = "gemini-1.5-pro-001" -SMART_ROUTER_NAME = "smart-router-001" STAGING_API_ENDPOINT = "STAGING_ENDPOINT" PROD_API_ENDPOINT = "PROD_ENDPOINT" @@ -166,7 +165,7 @@ def test_generate_content_latency(self, api_endpoint_env_name): import time from unittest import mock from vertexai.generative_models._generative_models import ( - prediction_service_v1 as prediction_service, + prediction_service, ) gapic_response_time = None @@ -495,21 +494,6 @@ def test_generate_content_function_calling(self, api_endpoint_env_name): assert summary - def test_generate_content_model_router(self, api_endpoint_env_name): - model = generative_models.GenerativeModel(SMART_ROUTER_NAME) - response = model.generate_content( - contents="Why is sky blue?", - generation_config=generative_models.GenerationConfig( - temperature=0, - routing_config=generative_models.GenerationConfig.RoutingConfig( - routing_config=generative_models.GenerationConfig.RoutingConfig.AutoRoutingMode( - model_routing_preference=generative_models.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference.BALANCED, - ), - ), - ), - ) - assert response.text - def test_chat_automatic_function_calling(self, api_endpoint_env_name): get_current_weather_func = generative_models.FunctionDeclaration.from_func( get_current_weather diff --git a/tests/unit/aiplatform/test_language_models.py b/tests/unit/aiplatform/test_language_models.py index 1a147899e8..950a80f292 100644 --- a/tests/unit/aiplatform/test_language_models.py +++ b/tests/unit/aiplatform/test_language_models.py @@ -4739,40 +4739,6 @@ def test_batch_prediction_for_code_generation(self): ) def test_batch_prediction_for_text_embedding(self): - """Tests batch prediction.""" - aiplatform.init( - project=_TEST_PROJECT, - location=_TEST_LOCATION, - ) - with mock.patch.object( - target=model_garden_service_client.ModelGardenServiceClient, - attribute="get_publisher_model", - return_value=gca_publisher_model.PublisherModel( - _TEXT_EMBEDDING_GECKO_PUBLISHER_MODEL_DICT - ), - ): - model = language_models.TextEmbeddingModel.from_pretrained( - "textembedding-gecko@001" - ) - - with mock.patch.object( - target=aiplatform.BatchPredictionJob, - attribute="create", - ) as mock_create: - model.batch_predict( - dataset="gs://test-bucket/test_table.jsonl", - destination_uri_prefix="gs://test-bucket/results/", - model_parameters={}, - ) - mock_create.assert_called_once_with( - model_name=f"projects/{_TEST_PROJECT}/locations/{_TEST_LOCATION}/publishers/google/models/textembedding-gecko@001", - job_display_name=None, - gcs_source="gs://test-bucket/test_table.jsonl", - gcs_destination_prefix="gs://test-bucket/results/", - model_parameters={}, - ) - - def test_batch_prediction_for_text_embedding_preview(self): """Tests batch prediction.""" aiplatform.init( project=_TEST_PROJECT, diff --git a/tests/unit/aiplatform/test_uploader.py b/tests/unit/aiplatform/test_uploader.py index 1b145eab0c..46e3141ac6 100644 --- a/tests/unit/aiplatform/test_uploader.py +++ b/tests/unit/aiplatform/test_uploader.py @@ -591,11 +591,6 @@ def test_start_uploading_without_create_experiment_fails(self): with self.assertRaisesRegex(RuntimeError, "call create_experiment()"): uploader.start_uploading() - @parameterized.parameters( - {"nested_run_dir": ""}, - {"nested_run_dir": "nested-dir/"}, - {"nested_run_dir": "double/nested-dir/"}, - ) @patch.object( uploader_utils.OnePlatformResourceManager, "get_run_resource_name", @@ -604,11 +599,7 @@ def test_start_uploading_without_create_experiment_fails(self): @patch.object(metadata, "_experiment_tracker", autospec=True) @patch.object(experiment_resources, "Experiment", autospec=True) def test_start_uploading_scalars( - self, - experiment_resources_mock, - experiment_tracker_mock, - run_resource_mock, - nested_run_dir, + self, experiment_resources_mock, experiment_tracker_mock, run_resource_mock ): experiment_resources_mock.get.return_value = _TEST_EXPERIMENT_NAME experiment_tracker_mock.set_experiment.return_value = _TEST_EXPERIMENT_NAME @@ -637,21 +628,21 @@ def test_start_uploading_scalars( mock_logdir_loader = mock.create_autospec(logdir_loader.LogdirLoader) mock_logdir_loader.get_run_events.side_effect = [ { - f"{nested_run_dir}run 1": _apply_compat( + "run 1": _apply_compat( [_scalar_event("1.1", 5.0), _scalar_event("1.2", 5.0)] ), - f"{nested_run_dir}run 2": _apply_compat( + "run 2": _apply_compat( [_scalar_event("2.1", 5.0), _scalar_event("2.2", 5.0)] ), }, { - f"{nested_run_dir}run 3": _apply_compat( + "run 3": _apply_compat( [_scalar_event("3.1", 5.0), _scalar_event("3.2", 5.0)] ), - f"{nested_run_dir}run 4": _apply_compat( + "run 4": _apply_compat( [_scalar_event("4.1", 5.0), _scalar_event("4.2", 5.0)] ), - f"{nested_run_dir}run 5": _apply_compat( + "run 5": _apply_compat( [_scalar_event("5.1", 5.0), _scalar_event("5.2", 5.0)] ), }, @@ -675,20 +666,11 @@ def test_start_uploading_scalars( self.assertEqual(mock_tracker.blob_tracker.call_count, 0) @parameterized.parameters( - { - "existing_experiment": None, - "one_platform_run_name": None, - "nested_run_dir": "", - }, - { - "existing_experiment": None, - "one_platform_run_name": ".", - "nested_run_dir": "nested-dir/", - }, + {"existing_experiment": None, "one_platform_run_name": None}, + {"existing_experiment": None, "one_platform_run_name": "."}, { "existing_experiment": _TEST_EXPERIMENT_NAME, "one_platform_run_name": _TEST_ONE_PLATFORM_RUN_NAME, - "nested_run_dir": "double/nested-dir/", }, ) @patch.object( @@ -711,7 +693,6 @@ def test_start_uploading_scalars_one_shot( run_resource_mock, existing_experiment, one_platform_run_name, - nested_run_dir, ): """Check that one-shot uploading stops without AbortUploadError.""" @@ -779,10 +760,10 @@ def batch_create_time_series(parent, requests): mock_logdir_loader = mock.create_autospec(logdir_loader.LogdirLoader) mock_logdir_loader.get_run_events.side_effect = [ { - f"{nested_run_dir}run 1": _apply_compat( + "run 1": _apply_compat( [_scalar_event("tag_1.1", 5.0), _scalar_event("tag_1.2", 5.0)] ), - f"{nested_run_dir}run 2": _apply_compat( + "run 2": _apply_compat( [_scalar_event("tag_2.1", 5.0), _scalar_event("tag_2.2", 5.0)] ), }, @@ -791,10 +772,10 @@ def batch_create_time_series(parent, requests): mock_logdir_loader_pre_create = mock.create_autospec(logdir_loader.LogdirLoader) mock_logdir_loader_pre_create.get_run_events.side_effect = [ { - f"{nested_run_dir}run 1": _apply_compat( + "run 1": _apply_compat( [_scalar_event("tag_1.1", 5.0), _scalar_event("tag_1.2", 5.0)] ), - f"{nested_run_dir}run 2": _apply_compat( + "run 2": _apply_compat( [_scalar_event("tag_2.1", 5.0), _scalar_event("tag_2.2", 5.0)] ), }, @@ -823,52 +804,6 @@ def batch_create_time_series(parent, requests): self.assertEqual(mock_tracker.blob_tracker.call_count, 0) experiment_tracker_mock.set_experiment.assert_called_once() - @parameterized.parameters( - {"nested_run_dir": ""}, - {"nested_run_dir": "nested-dir/"}, - {"nested_run_dir": "double/nested-dir/"}, - ) - @patch.object(metadata, "_experiment_tracker", autospec=True) - @patch.object(experiment_resources, "Experiment", autospec=True) - def test_upload_nested_scalars_one_shot( - self, - experiment_resources_mock, - experiment_tracker_mock, - nested_run_dir, - ): - """Check that one-shot uploading stops without AbortUploadError.""" - - logdir = self.get_temp_dir() - uploader = _create_uploader( - logdir=logdir, - ) - uploader.create_experiment() - - run_1 = f"{nested_run_dir}run 1" - run_2 = f"{nested_run_dir}run 2" - - mock_dispatcher = mock.create_autospec(uploader_lib._Dispatcher) - uploader._dispatcher = mock_dispatcher - mock_logdir_loader = mock.create_autospec(logdir_loader.LogdirLoader) - mock_logdir_loader.get_run_events.side_effect = [ - { - run_1: _apply_compat( - [_scalar_event("tag_1.1", 5.0), _scalar_event("tag_1.2", 5.0)] - ), - run_2: _apply_compat( - [_scalar_event("tag_2.1", 5.0), _scalar_event("tag_2.2", 5.0)] - ), - }, - ] - with mock.patch.object(uploader, "_logdir_loader", mock_logdir_loader): - uploader._upload_once() - - self.assertEqual(1, mock_logdir_loader.get_run_events.call_count) - self.assertEqual(1, mock_dispatcher.dispatch_requests.call_count) - run_to_events = mock_dispatcher.dispatch_requests.call_args[0][0] - self.assertIn(run_1, run_to_events) - self.assertIn(run_2, run_to_events) - @patch.object(metadata, "_experiment_tracker", autospec=True) @patch.object(experiment_resources, "Experiment", autospec=True) def test_upload_empty_logdir( diff --git a/tests/unit/gapic/aiplatform_v1/test_prediction_service.py b/tests/unit/gapic/aiplatform_v1/test_prediction_service.py index 56a3a2dfc1..1b062cfbb8 100644 --- a/tests/unit/gapic/aiplatform_v1/test_prediction_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_prediction_service.py @@ -4126,9 +4126,7 @@ def test_generate_content(request_type, transport: str = "grpc"): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.generate_content), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = prediction_service.GenerateContentResponse( - model_version="model_version_value", - ) + call.return_value = prediction_service.GenerateContentResponse() response = client.generate_content(request) # Establish that the underlying gRPC stub method was called. @@ -4139,7 +4137,6 @@ def test_generate_content(request_type, transport: str = "grpc"): # Establish that the response is the type that we expect. assert isinstance(response, prediction_service.GenerateContentResponse) - assert response.model_version == "model_version_value" def test_generate_content_empty_call(): @@ -4239,9 +4236,7 @@ async def test_generate_content_empty_call_async(): with mock.patch.object(type(client.transport.generate_content), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - prediction_service.GenerateContentResponse( - model_version="model_version_value", - ) + prediction_service.GenerateContentResponse() ) response = await client.generate_content() call.assert_called() @@ -4309,9 +4304,7 @@ async def test_generate_content_async( with mock.patch.object(type(client.transport.generate_content), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - prediction_service.GenerateContentResponse( - model_version="model_version_value", - ) + prediction_service.GenerateContentResponse() ) response = await client.generate_content(request) @@ -4323,7 +4316,6 @@ async def test_generate_content_async( # Establish that the response is the type that we expect. assert isinstance(response, prediction_service.GenerateContentResponse) - assert response.model_version == "model_version_value" @pytest.mark.asyncio @@ -6959,9 +6951,7 @@ def test_generate_content_rest(request_type): # Mock the http request call within the method and fake a response. with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. - return_value = prediction_service.GenerateContentResponse( - model_version="model_version_value", - ) + return_value = prediction_service.GenerateContentResponse() # Wrap the value into a proper Response obj response_value = Response() @@ -6976,7 +6966,6 @@ def test_generate_content_rest(request_type): # Establish that the response is the type that we expect. assert isinstance(response, prediction_service.GenerateContentResponse) - assert response.model_version == "model_version_value" def test_generate_content_rest_use_cached_wrapped_rpc(): @@ -7277,9 +7266,7 @@ def test_stream_generate_content_rest(request_type): # Mock the http request call within the method and fake a response. with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. - return_value = prediction_service.GenerateContentResponse( - model_version="model_version_value", - ) + return_value = prediction_service.GenerateContentResponse() # Wrap the value into a proper Response obj response_value = Response() @@ -7301,7 +7288,6 @@ def test_stream_generate_content_rest(request_type): # Establish that the response is the type that we expect. assert isinstance(response, prediction_service.GenerateContentResponse) - assert response.model_version == "model_version_value" def test_stream_generate_content_rest_use_cached_wrapped_rpc(): diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_extension_registry_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_extension_registry_service.py index 98eb0a48c7..c42560846a 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_extension_registry_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_extension_registry_service.py @@ -3394,7 +3394,6 @@ def test_import_extension_rest(request_type): "max_length": 1063, "pattern": "pattern_value", "example": {}, - "any_of": {}, }, "response": {}, }, @@ -4586,7 +4585,6 @@ def test_update_extension_rest(request_type): "max_length": 1063, "pattern": "pattern_value", "example": {}, - "any_of": {}, }, "response": {}, }, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_cache_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_cache_service.py index bb52d0d34c..e648c041b4 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_cache_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_cache_service.py @@ -3456,7 +3456,6 @@ def test_create_cached_content_rest(request_type): "max_length": 1063, "pattern": "pattern_value", "example": {}, - "any_of": {}, }, "response": {}, } @@ -4279,7 +4278,6 @@ def test_update_cached_content_rest(request_type): "max_length": 1063, "pattern": "pattern_value", "example": {}, - "any_of": {}, }, "response": {}, } diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py index b52c5f17d9..230617a9f2 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py @@ -4705,9 +4705,6 @@ def test_create_index_endpoint_rest(request_type): "reserved_ip_ranges_value2", ], "deployment_group": "deployment_group_value", - "psc_automation_configs": [ - {"project_id": "project_id_value", "network": "network_value"} - ], } ], "etag": "etag_value", @@ -5899,9 +5896,6 @@ def test_update_index_endpoint_rest(request_type): "reserved_ip_ranges_value2", ], "deployment_group": "deployment_group_value", - "psc_automation_configs": [ - {"project_id": "project_id_value", "network": "network_value"} - ], } ], "etag": "etag_value", @@ -7330,9 +7324,6 @@ def test_mutate_deployed_index_rest(request_type): "reserved_ip_ranges_value2", ], "deployment_group": "deployment_group_value", - "psc_automation_configs": [ - {"project_id": "project_id_value", "network": "network_value"} - ], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py index 0b9bdfee3b..ddc484f2aa 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py @@ -78,7 +78,6 @@ from google.cloud.aiplatform_v1beta1.types import ( training_pipeline as gca_training_pipeline, ) -from google.cloud.aiplatform_v1beta1.types import ui_pipeline_spec from google.cloud.aiplatform_v1beta1.types import value from google.cloud.location import locations_pb2 from google.iam.v1 import iam_policy_pb2 # type: ignore @@ -3416,7 +3415,6 @@ def test_create_pipeline_job(request_type, transport: str = "grpc"): preflight_validations=True, satisfies_pzs=True, satisfies_pzi=True, - original_pipeline_job_id=2512, ) response = client.create_pipeline_job(request) @@ -3439,7 +3437,6 @@ def test_create_pipeline_job(request_type, transport: str = "grpc"): assert response.preflight_validations is True assert response.satisfies_pzs is True assert response.satisfies_pzi is True - assert response.original_pipeline_job_id == 2512 def test_create_pipeline_job_empty_call(): @@ -3561,7 +3558,6 @@ async def test_create_pipeline_job_empty_call_async(): preflight_validations=True, satisfies_pzs=True, satisfies_pzi=True, - original_pipeline_job_id=2512, ) ) response = await client.create_pipeline_job() @@ -3644,7 +3640,6 @@ async def test_create_pipeline_job_async( preflight_validations=True, satisfies_pzs=True, satisfies_pzi=True, - original_pipeline_job_id=2512, ) ) response = await client.create_pipeline_job(request) @@ -3668,7 +3663,6 @@ async def test_create_pipeline_job_async( assert response.preflight_validations is True assert response.satisfies_pzs is True assert response.satisfies_pzi is True - assert response.original_pipeline_job_id == 2512 @pytest.mark.asyncio @@ -3879,7 +3873,6 @@ def test_get_pipeline_job(request_type, transport: str = "grpc"): preflight_validations=True, satisfies_pzs=True, satisfies_pzi=True, - original_pipeline_job_id=2512, ) response = client.get_pipeline_job(request) @@ -3902,7 +3895,6 @@ def test_get_pipeline_job(request_type, transport: str = "grpc"): assert response.preflight_validations is True assert response.satisfies_pzs is True assert response.satisfies_pzi is True - assert response.original_pipeline_job_id == 2512 def test_get_pipeline_job_empty_call(): @@ -4014,7 +4006,6 @@ async def test_get_pipeline_job_empty_call_async(): preflight_validations=True, satisfies_pzs=True, satisfies_pzi=True, - original_pipeline_job_id=2512, ) ) response = await client.get_pipeline_job() @@ -4094,7 +4085,6 @@ async def test_get_pipeline_job_async( preflight_validations=True, satisfies_pzs=True, satisfies_pzi=True, - original_pipeline_job_id=2512, ) ) response = await client.get_pipeline_job(request) @@ -4118,7 +4108,6 @@ async def test_get_pipeline_job_async( assert response.preflight_validations is True assert response.satisfies_pzs is True assert response.satisfies_pzi is True - assert response.original_pipeline_job_id == 2512 @pytest.mark.asyncio @@ -8438,16 +8427,6 @@ def test_create_pipeline_job_rest(request_type): "preflight_validations": True, "satisfies_pzs": True, "satisfies_pzi": True, - "original_pipeline_job_id": 2512, - "pipeline_task_rerun_configs": [ - { - "task_id": 735, - "task_name": "task_name_value", - "inputs": {"artifacts": {}, "parameter_values": {}}, - "skip_task": True, - "skip_downstream_tasks": True, - } - ], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -8533,7 +8512,6 @@ def get_message_fields(field): preflight_validations=True, satisfies_pzs=True, satisfies_pzi=True, - original_pipeline_job_id=2512, ) # Wrap the value into a proper Response obj @@ -8560,7 +8538,6 @@ def get_message_fields(field): assert response.preflight_validations is True assert response.satisfies_pzs is True assert response.satisfies_pzi is True - assert response.original_pipeline_job_id == 2512 def test_create_pipeline_job_rest_use_cached_wrapped_rpc(): @@ -8877,7 +8854,6 @@ def test_get_pipeline_job_rest(request_type): preflight_validations=True, satisfies_pzs=True, satisfies_pzi=True, - original_pipeline_job_id=2512, ) # Wrap the value into a proper Response obj @@ -8904,7 +8880,6 @@ def test_get_pipeline_job_rest(request_type): assert response.preflight_validations is True assert response.satisfies_pzs is True assert response.satisfies_pzi is True - assert response.original_pipeline_job_id == 2512 def test_get_pipeline_job_rest_use_cached_wrapped_rpc(): diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py index 34296a82fd..8e68ac830a 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py @@ -4508,9 +4508,7 @@ def test_generate_content(request_type, transport: str = "grpc"): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.generate_content), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = prediction_service.GenerateContentResponse( - model_version="model_version_value", - ) + call.return_value = prediction_service.GenerateContentResponse() response = client.generate_content(request) # Establish that the underlying gRPC stub method was called. @@ -4521,7 +4519,6 @@ def test_generate_content(request_type, transport: str = "grpc"): # Establish that the response is the type that we expect. assert isinstance(response, prediction_service.GenerateContentResponse) - assert response.model_version == "model_version_value" def test_generate_content_empty_call(): @@ -4623,9 +4620,7 @@ async def test_generate_content_empty_call_async(): with mock.patch.object(type(client.transport.generate_content), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - prediction_service.GenerateContentResponse( - model_version="model_version_value", - ) + prediction_service.GenerateContentResponse() ) response = await client.generate_content() call.assert_called() @@ -4693,9 +4688,7 @@ async def test_generate_content_async( with mock.patch.object(type(client.transport.generate_content), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - prediction_service.GenerateContentResponse( - model_version="model_version_value", - ) + prediction_service.GenerateContentResponse() ) response = await client.generate_content(request) @@ -4707,7 +4700,6 @@ async def test_generate_content_async( # Establish that the response is the type that we expect. assert isinstance(response, prediction_service.GenerateContentResponse) - assert response.model_version == "model_version_value" @pytest.mark.asyncio @@ -8022,9 +8014,7 @@ def test_generate_content_rest(request_type): # Mock the http request call within the method and fake a response. with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. - return_value = prediction_service.GenerateContentResponse( - model_version="model_version_value", - ) + return_value = prediction_service.GenerateContentResponse() # Wrap the value into a proper Response obj response_value = Response() @@ -8039,7 +8029,6 @@ def test_generate_content_rest(request_type): # Establish that the response is the type that we expect. assert isinstance(response, prediction_service.GenerateContentResponse) - assert response.model_version == "model_version_value" def test_generate_content_rest_use_cached_wrapped_rpc(): @@ -8340,9 +8329,7 @@ def test_stream_generate_content_rest(request_type): # Mock the http request call within the method and fake a response. with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. - return_value = prediction_service.GenerateContentResponse( - model_version="model_version_value", - ) + return_value = prediction_service.GenerateContentResponse() # Wrap the value into a proper Response obj response_value = Response() @@ -8364,7 +8351,6 @@ def test_stream_generate_content_rest(request_type): # Establish that the response is the type that we expect. assert isinstance(response, prediction_service.GenerateContentResponse) - assert response.model_version == "model_version_value" def test_stream_generate_content_rest_use_cached_wrapped_rpc(): diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_schedule_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_schedule_service.py index c4ffde8062..551b7d1ee6 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_schedule_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_schedule_service.py @@ -83,7 +83,6 @@ from google.cloud.aiplatform_v1beta1.types import schedule from google.cloud.aiplatform_v1beta1.types import schedule as gca_schedule from google.cloud.aiplatform_v1beta1.types import schedule_service -from google.cloud.aiplatform_v1beta1.types import ui_pipeline_spec from google.cloud.aiplatform_v1beta1.types import value from google.cloud.location import locations_pb2 from google.iam.v1 import iam_policy_pb2 # type: ignore @@ -4175,16 +4174,6 @@ def test_create_schedule_rest(request_type): "preflight_validations": True, "satisfies_pzs": True, "satisfies_pzi": True, - "original_pipeline_job_id": 2512, - "pipeline_task_rerun_configs": [ - { - "task_id": 735, - "task_name": "task_name_value", - "inputs": {"artifacts": {}, "parameter_values": {}}, - "skip_task": True, - "skip_downstream_tasks": True, - } - ], }, "pipeline_job_id": "pipeline_job_id_value", }, @@ -6476,16 +6465,6 @@ def test_update_schedule_rest(request_type): "preflight_validations": True, "satisfies_pzs": True, "satisfies_pzi": True, - "original_pipeline_job_id": 2512, - "pipeline_task_rerun_configs": [ - { - "task_id": 735, - "task_name": "task_name_value", - "inputs": {"artifacts": {}, "parameter_values": {}}, - "skip_task": True, - "skip_downstream_tasks": True, - } - ], }, "pipeline_job_id": "pipeline_job_id_value", }, diff --git a/tests/unit/vertex_rag/test_rag_constants.py b/tests/unit/vertex_rag/test_rag_constants.py index e85e176006..79a7dc5e5f 100644 --- a/tests/unit/vertex_rag/test_rag_constants.py +++ b/tests/unit/vertex_rag/test_rag_constants.py @@ -29,7 +29,6 @@ JiraSource, JiraQuery, Weaviate, - VertexVectorSearch, VertexFeatureStore, ) from google.cloud.aiplatform_v1beta1 import ( @@ -79,12 +78,6 @@ index_name=TEST_PINECONE_INDEX_NAME, api_key=TEST_PINECONE_API_KEY_SECRET_VERSION, ) -TEST_VERTEX_VECTOR_SEARCH_INDEX_ENDPOINT = "test-vector-search-index-endpoint" -TEST_VERTEX_VECTOR_SEARCH_INDEX = "test-vector-search-index" -TEST_VERTEX_VECTOR_SEARCH_CONFIG = VertexVectorSearch( - index_endpoint=TEST_VERTEX_VECTOR_SEARCH_INDEX_ENDPOINT, - index=TEST_VERTEX_VECTOR_SEARCH_INDEX, -) TEST_VERTEX_FEATURE_STORE_RESOURCE_NAME = "test-feature-view-resource-name" TEST_GAPIC_RAG_CORPUS = GapicRagCorpus( name=TEST_RAG_CORPUS_RESOURCE_NAME, @@ -122,17 +115,6 @@ ), ), ) -TEST_GAPIC_RAG_CORPUS_VERTEX_VECTOR_SEARCH = GapicRagCorpus( - name=TEST_RAG_CORPUS_RESOURCE_NAME, - display_name=TEST_CORPUS_DISPLAY_NAME, - description=TEST_CORPUS_DISCRIPTION, - rag_vector_db_config=RagVectorDbConfig( - vertex_vector_search=RagVectorDbConfig.VertexVectorSearch( - index_endpoint=TEST_VERTEX_VECTOR_SEARCH_INDEX_ENDPOINT, - index=TEST_VERTEX_VECTOR_SEARCH_INDEX, - ), - ), -) TEST_GAPIC_RAG_CORPUS_PINECONE = GapicRagCorpus( name=TEST_RAG_CORPUS_RESOURCE_NAME, display_name=TEST_CORPUS_DISPLAY_NAME, @@ -176,12 +158,6 @@ description=TEST_CORPUS_DISCRIPTION, vector_db=TEST_PINECONE_CONFIG, ) -TEST_RAG_CORPUS_VERTEX_VECTOR_SEARCH = RagCorpus( - name=TEST_RAG_CORPUS_RESOURCE_NAME, - display_name=TEST_CORPUS_DISPLAY_NAME, - description=TEST_CORPUS_DISCRIPTION, - vector_db=TEST_VERTEX_VECTOR_SEARCH_CONFIG, -) TEST_PAGE_TOKEN = "test-page-token" # RagFiles diff --git a/tests/unit/vertex_rag/test_rag_data.py b/tests/unit/vertex_rag/test_rag_data.py index c20011c361..89c509e249 100644 --- a/tests/unit/vertex_rag/test_rag_data.py +++ b/tests/unit/vertex_rag/test_rag_data.py @@ -79,23 +79,6 @@ def create_rag_corpus_mock_vertex_feature_store(): yield create_rag_corpus_mock_vertex_feature_store -@pytest.fixture -def create_rag_corpus_mock_vertex_vector_search(): - with mock.patch.object( - VertexRagDataServiceClient, - "create_rag_corpus", - ) as create_rag_corpus_mock_vertex_vector_search: - create_rag_corpus_lro_mock = mock.Mock(ga_operation.Operation) - create_rag_corpus_lro_mock.done.return_value = True - create_rag_corpus_lro_mock.result.return_value = ( - tc.TEST_GAPIC_RAG_CORPUS_VERTEX_VECTOR_SEARCH - ) - create_rag_corpus_mock_vertex_vector_search.return_value = ( - create_rag_corpus_lro_mock - ) - yield create_rag_corpus_mock_vertex_vector_search - - @pytest.fixture def create_rag_corpus_mock_pinecone(): with mock.patch.object( @@ -274,15 +257,6 @@ def test_create_corpus_vertex_feature_store_success(self): rag_corpus_eq(rag_corpus, tc.TEST_RAG_CORPUS_VERTEX_FEATURE_STORE) - @pytest.mark.usefixtures("create_rag_corpus_mock_vertex_vector_search") - def test_create_corpus_vertex_vector_search_success(self): - rag_corpus = rag.create_corpus( - display_name=tc.TEST_CORPUS_DISPLAY_NAME, - vector_db=tc.TEST_VERTEX_VECTOR_SEARCH_CONFIG, - ) - - rag_corpus_eq(rag_corpus, tc.TEST_RAG_CORPUS_VERTEX_VECTOR_SEARCH) - @pytest.mark.usefixtures("create_rag_corpus_mock_pinecone") def test_create_corpus_pinecone_success(self): rag_corpus = rag.create_corpus( diff --git a/vertexai/evaluation/metrics/_default_templates.py b/vertexai/evaluation/metrics/_default_templates.py index ccf7247da8..223cf70eb5 100644 --- a/vertexai/evaluation/metrics/_default_templates.py +++ b/vertexai/evaluation/metrics/_default_templates.py @@ -390,7 +390,7 @@ ## Evaluation Steps STEP 1: Analyze Response A based on the instruction following criteria: Determine how well Response A fulfills the requirements outlined in the instructions and provide assessment according to the criterion. -STEP 2: Analyze Response B based on the instruction following criteria: Determine how well Response B fulfills the requirements outlined in the instructions and provide assessment according to the criterion. +STEP 2: Analyze Response B based on the instruction following criteria: Determine how well Response A fulfills the requirements outlined in the instructions and provide assessment according to the criterion. STEP 3: Compare the overall performance of Response A and Response B based on your analyses and assessment. STEP 4: Output your preference of "A", "SAME" or "B" to the pairwise_choice field according to the Rating Rubric. STEP 5: Output your assessment reasoning in the explanation field. @@ -900,7 +900,7 @@ ## Evaluation Steps STEP 1: Analyze Response A based on the question answering quality criteria: Determine how well Response A fulfills the user requirements, is grounded in the context, is complete and fluent, and provides assessment according to the criterion. -STEP 2: Analyze Response B based on the question answering quality criteria: Determine how well Response B fulfills the user requirements, is grounded in the context, is complete and fluent, and provides assessment according to the criterion. +STEP 2: Analyze Response B based on the question answering quality criteria: Determine how well Response A fulfills the user requirements, is grounded in the context, is complete and fluent, and provides assessment according to the criterion. STEP 3: Compare the overall performance of Response A and Response B based on your analyses and assessment. STEP 4: Output your preference of "A", "SAME" or "B" to the pairwise_choice field according to the Rating Rubric. STEP 5: Output your assessment reasoning in the explanation field. diff --git a/vertexai/generative_models/_generative_models.py b/vertexai/generative_models/_generative_models.py index bdd24c3847..30073e2ae4 100644 --- a/vertexai/generative_models/_generative_models.py +++ b/vertexai/generative_models/_generative_models.py @@ -1576,7 +1576,6 @@ def __init__( response_mime_type: Optional[str] = None, response_schema: Optional[Dict[str, Any]] = None, seed: Optional[int] = None, - routing_config: Optional["RoutingConfig"] = None, ): r"""Constructs a GenerationConfig object. @@ -1602,7 +1601,6 @@ def __init__( response type, otherwise the behavior is undefined. response_schema: Output response schema of the genreated candidate text. Only valid when response_mime_type is application/json. - routing_config: Model routing preference set in the request. Usage: ``` @@ -1638,10 +1636,6 @@ def __init__( response_schema=raw_schema, seed=seed, ) - if routing_config is not None: - self._raw_generation_config.routing_config = ( - routing_config._gapic_routing_config - ) @classmethod def _from_gapic( @@ -1665,109 +1659,6 @@ def to_dict(self) -> Dict[str, Any]: def __repr__(self) -> str: return self._raw_generation_config.__repr__() - class RoutingConfig: - r"""The configuration for model router requests. - - The routing config is either one of the two nested classes: - - AutoRoutingMode: Automated routing. - - ManualRoutingMode: Manual routing. - - Usage: - - AutoRoutingMode: - - ``` - routing_config=generative_models.RoutingConfig( - routing_config=generative_models.RoutingConfig.AutoRoutingMode( - model_routing_preference=generative_models.RoutingConfig.AutoRoutingMode.ModelRoutingPreference.BALANCED, - ), - ) - ``` - - ManualRoutingMode: - - ``` - routing_config=generative_models.RoutingConfig( - routing_config=generative_models.RoutingConfig.ManutalRoutingMode( - model_name="gemini-1.5-pro-001", - ), - ) - ``` - """ - - def __init__( - self, - *, - routing_config: Union[ - "GenerationConfig.RoutingConfig.AutoRoutingMode", - "GenerationConfig.RoutingConfig.ManualRoutingMode", - ], - ): - if isinstance(routing_config, self.AutoRoutingMode): - self._gapic_routing_config = ( - gapic_content_types.GenerationConfig.RoutingConfig( - auto_mode=routing_config._gapic_auto_mode - ) - ) - else: - self._gapic_routing_config = ( - gapic_content_types.GenerationConfig.RoutingConfig( - manual_mode=routing_config._gapic_manual_mode - ) - ) - - def __repr__(self): - return self._gapic_routing_config.__repr__() - - class AutoRoutingMode: - r"""When automated routing is specified, the routing will be - determined by the routing model predicted quality and customer provided - model routing preference. - """ - - ModelRoutingPreference = ( - gapic_content_types.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference - ) - - def __init__( - self, - *, - model_routing_preference: "GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference", - ): - r"""AutoRouingMode constructor - - Args: - model_routing_preference: Model routing preference for the routing request. - """ - self._gapic_auto_mode = ( - gapic_content_types.GenerationConfig.RoutingConfig.AutoRoutingMode( - model_routing_preference=model_routing_preference - ) - ) - - def __repr__(self): - return self._gapic_auto_mode.__repr__() - - class ManualRoutingMode: - r"""When manual routing is set, the specified model will be used - directly. - """ - - def __init__( - self, - *, - model_name: str, - ): - r"""ManualRoutingMode constructor - - Args: - model_name: The model to use. Only public LLM model names and those that are supported by the router are allowed. - """ - self._gapic_manual_mode = gapic_content_types.GenerationConfig.RoutingConfig.ManualRoutingMode( - model_name=model_name - ) - - def __repr__(self): - return self._gapic_manual_mode.__repr__() - class Tool: r"""A collection of functions that the model may use to generate response. @@ -3069,7 +2960,7 @@ def _gapic_compute_tokens( prediction_resource_name: str, contents: List[gapic_content_types.Content], ) -> gapic_prediction_service_types.CountTokensResponse: - request = types_v1.ComputeTokensRequest( + request = gapic_llm_utility_service_types.ComputeTokensRequest( endpoint=prediction_resource_name, model=prediction_resource_name, contents=contents, @@ -3081,7 +2972,7 @@ async def _gapic_compute_tokens_async( prediction_resource_name: str, contents: List[gapic_content_types.Content], ) -> gapic_prediction_service_types.CountTokensResponse: - request = types_v1.ComputeTokensRequest( + request = gapic_llm_utility_service_types.ComputeTokensRequest( endpoint=prediction_resource_name, model=prediction_resource_name, contents=contents, diff --git a/vertexai/language_models/_language_models.py b/vertexai/language_models/_language_models.py index f4b9a17859..df756d268c 100644 --- a/vertexai/language_models/_language_models.py +++ b/vertexai/language_models/_language_models.py @@ -2421,7 +2421,6 @@ class _TunableTextEmbeddingModelMixin(_PreviewTunableTextEmbeddingModelMixin): class TextEmbeddingModel( _TextEmbeddingModel, - _ModelWithBatchPredict, _TunableTextEmbeddingModelMixin, _CountTokensMixin, ): @@ -2431,8 +2430,8 @@ class TextEmbeddingModel( class _PreviewTextEmbeddingModel( _TextEmbeddingModel, _ModelWithBatchPredict, - _PreviewTunableTextEmbeddingModelMixin, _CountTokensMixin, + _PreviewTunableTextEmbeddingModelMixin, ): __name__ = "TextEmbeddingModel" __module__ = "vertexai.preview.language_models" diff --git a/vertexai/preview/rag/__init__.py b/vertexai/preview/rag/__init__.py index 7c7737276b..3ad4a782e0 100644 --- a/vertexai/preview/rag/__init__.py +++ b/vertexai/preview/rag/__init__.py @@ -47,7 +47,6 @@ SlackChannel, SlackChannelsSource, VertexFeatureStore, - VertexVectorSearch, Weaviate, ) @@ -65,7 +64,6 @@ "SlackChannelsSource", "VertexFeatureStore", "VertexRagStore", - "VertexVectorSearch", "Weaviate", "create_corpus", "delete_corpus", diff --git a/vertexai/preview/rag/rag_data.py b/vertexai/preview/rag/rag_data.py index e332b0337b..fe2c697f2a 100644 --- a/vertexai/preview/rag/rag_data.py +++ b/vertexai/preview/rag/rag_data.py @@ -50,7 +50,6 @@ RagFile, SlackChannelsSource, VertexFeatureStore, - VertexVectorSearch, Weaviate, ) @@ -59,9 +58,7 @@ def create_corpus( display_name: Optional[str] = None, description: Optional[str] = None, embedding_model_config: Optional[EmbeddingModelConfig] = None, - vector_db: Optional[ - Union[Weaviate, VertexFeatureStore, VertexVectorSearch, Pinecone] - ] = None, + vector_db: Optional[Union[Weaviate, VertexFeatureStore, Pinecone]] = None, ) -> RagCorpus: """Creates a new RagCorpus resource. diff --git a/vertexai/preview/rag/utils/_gapic_utils.py b/vertexai/preview/rag/utils/_gapic_utils.py index fe513a4ecf..8e729d6cc7 100644 --- a/vertexai/preview/rag/utils/_gapic_utils.py +++ b/vertexai/preview/rag/utils/_gapic_utils.py @@ -44,7 +44,6 @@ SlackChannelsSource, JiraSource, VertexFeatureStore, - VertexVectorSearch, Weaviate, ) @@ -98,58 +97,25 @@ def convert_gapic_to_embedding_model_config( return embedding_model_config -def _check_weaviate(gapic_vector_db: RagVectorDbConfig) -> bool: - try: - return gapic_vector_db.__contains__("weaviate") - except AttributeError: - return gapic_vector_db.weaviate.ByteSize() > 0 - - -def _check_vertex_feature_store(gapic_vector_db: RagVectorDbConfig) -> bool: - try: - return gapic_vector_db.__contains__("vertex_feature_store") - except AttributeError: - return gapic_vector_db.vertex_feature_store.ByteSize() > 0 - - -def _check_pinecone(gapic_vector_db: RagVectorDbConfig) -> bool: - try: - return gapic_vector_db.__contains__("pinecone") - except AttributeError: - return gapic_vector_db.pinecone.ByteSize() > 0 - - -def _check_vertex_vector_search(gapic_vector_db: RagVectorDbConfig) -> bool: - try: - return gapic_vector_db.__contains__("vertex_vector_search") - except AttributeError: - return gapic_vector_db.vertex_vector_search.ByteSize() > 0 - - def convert_gapic_to_vector_db( gapic_vector_db: RagVectorDbConfig, -) -> Union[Weaviate, VertexFeatureStore, VertexVectorSearch, Pinecone]: - """Convert Gapic RagVectorDbConfig to Weaviate, VertexFeatureStore, VertexVectorSearch, or Pinecone.""" - if _check_weaviate(gapic_vector_db): +) -> Union[Weaviate, VertexFeatureStore, Pinecone]: + """Convert Gapic RagVectorDbConfig to Weaviate, VertexFeatureStore, or Pinecone.""" + if gapic_vector_db.__contains__("weaviate"): return Weaviate( weaviate_http_endpoint=gapic_vector_db.weaviate.http_endpoint, collection_name=gapic_vector_db.weaviate.collection_name, api_key=gapic_vector_db.api_auth.api_key_config.api_key_secret_version, ) - elif _check_vertex_feature_store(gapic_vector_db): + elif gapic_vector_db.__contains__("vertex_feature_store"): return VertexFeatureStore( resource_name=gapic_vector_db.vertex_feature_store.feature_view_resource_name, ) - elif _check_pinecone(gapic_vector_db): + elif gapic_vector_db.__contains__("pinecone"): return Pinecone( index_name=gapic_vector_db.pinecone.index_name, api_key=gapic_vector_db.api_auth.api_key_config.api_key_secret_version, ) - elif _check_vertex_vector_search(gapic_vector_db): - return VertexVectorSearch( - index_endpoint=gapic_vector_db.vertex_vector_search.index_endpoint, - index=gapic_vector_db.vertex_vector_search.index, - ) else: return None @@ -452,7 +418,7 @@ def set_embedding_model_config( def set_vector_db( - vector_db: Union[Weaviate, VertexFeatureStore, VertexVectorSearch, Pinecone], + vector_db: Union[Weaviate, VertexFeatureStore, Pinecone], rag_corpus: GapicRagCorpus, ) -> None: """Sets the vector db configuration for the rag corpus.""" @@ -480,16 +446,6 @@ def set_vector_db( feature_view_resource_name=resource_name, ), ) - elif isinstance(vector_db, VertexVectorSearch): - index_endpoint = vector_db.index_endpoint - index = vector_db.index - - rag_corpus.rag_vector_db_config = RagVectorDbConfig( - vertex_vector_search=RagVectorDbConfig.VertexVectorSearch( - index_endpoint=index_endpoint, - index=index, - ), - ) elif isinstance(vector_db, Pinecone): index_name = vector_db.index_name api_key = vector_db.api_key @@ -506,5 +462,5 @@ def set_vector_db( ) else: raise TypeError( - "vector_db must be a Weaviate, VertexFeatureStore, VertexVectorSearch, or Pinecone." + "vector_db must be a Weaviate, VertexFeatureStore, or Pinecone." ) diff --git a/vertexai/preview/rag/utils/resources.py b/vertexai/preview/rag/utils/resources.py index 371ccc3e9e..8ae2a184ab 100644 --- a/vertexai/preview/rag/utils/resources.py +++ b/vertexai/preview/rag/utils/resources.py @@ -98,23 +98,6 @@ class VertexFeatureStore: resource_name: str -@dataclasses.dataclass -class VertexVectorSearch: - """VertexVectorSearch. - - Attributes: - index_endpoint (str): - The resource name of the Index Endpoint. Format: - ``projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`` - index (str): - The resource name of the Index. Format: - ``projects/{project}/locations/{location}/indexes/{index}`` - """ - - index_endpoint: str - index: str - - @dataclasses.dataclass class Pinecone: """Pinecone. @@ -146,9 +129,7 @@ class RagCorpus: display_name: Optional[str] = None description: Optional[str] = None embedding_model_config: Optional[EmbeddingModelConfig] = None - vector_db: Optional[ - Union[Weaviate, VertexFeatureStore, VertexVectorSearch, Pinecone] - ] = None + vector_db: Optional[Union[Weaviate, VertexFeatureStore, Pinecone]] = None @dataclasses.dataclass