8000 chore: remove prompt_optimizer property from GenAI client · googleapis/python-aiplatform@0a26a20 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0a26a20

Browse files
sararobcopybara-github
authored andcommitted
chore: remove prompt_optimizer property from GenAI client
PiperOrigin-RevId: 773126369
1 parent c43de0a commit 0a26a20

File tree

2 files changed

+28
-38
lines changed

2 files changed

+28
-38
lines changed

tests/unit/vertexai/genai/test_prompt_optimizer.py

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
from google.cloud.aiplatform.compat.types import (
2929
job_state as gca_job_state_compat,
3030
)
31-
from google.cloud.aiplatform.utils import gcs_utils
32-
from google.genai import client
31+
32+
# from google.cloud.aiplatform.utils import gcs_utils
33+
# from google.genai import client
3334
import pytest
3435

3536

@@ -76,29 +77,29 @@ def setup_method(self):
7677
location=_TEST_LOCATION,
7778
)
7879

79-
@pytest.mark.usefixtures("google_auth_mock")
80-
def test_prompt_optimizer_client(self):
81-
test_client = vertexai.Client(project=_TEST_PROJECT, location=_TEST_LOCATION)
82-
assert test_client is not None
83-
assert test_client._api_client.vertexai
84-
assert test_client._api_client.project == _TEST_PROJECT
85-
assert test_client._api_client.location == _TEST_LOCATION
80+
# @pytest.mark.usefixtures("google_auth_mock")
81+
# def test_prompt_optimizer_client(self):
82+
# test_client = vertexai.Client(project=_TEST_PROJECT, location=_TEST_LOCATION)
83+
# assert test_client is not None
84+
# assert test_client._api_client.vertexai
85+
# assert test_client._api_client.project == _TEST_PROJECT
86+
# assert test_client._api_client.location == _TEST_LOCATION
8687

87-
@mock.patch.object(client.Client, "_get_api_client")
88-
@mock.patch.object(
89-
gcs_utils.resource_manager_utils, "get_project_number", return_value=12345
90-
)
91-
def test_prompt_optimizer_optimize(
92-
self, mock_get_project_number, mock_client, mock_create_custom_job
93-
):
94-
"""Test that prompt_optimizer.optimize method creates a custom job."""
95-
test_client = vertexai.Client(project=_TEST_PROJECT, location=_TEST_LOCATION)
96-
test_client.prompt_optimizer.optimize(
97-
method="vapo",
98-
config={
99-
"config_path": "gs://ssusie-vapo-sdk-test/config.json",
100-
"wait_for_completion": False,
101-
},
102-
)
103-
mock_create_custom_job.assert_called_once()
104-
mock_get_project_number.assert_called_once()
88+
# @mock.patch.object(client.Client, "_get_api_client")
89+
# @mock.patch.object(
90+
# gcs_utils.resource_manager_utils, "get_project_number", return_value=12345
91+
# )
92+
# def test_prompt_optimizer_optimize(
93+
# self, mock_get_project_number, mock_client, mock_create_custom_job
94+
# ):
95+
# """Test that prompt_optimizer.optimize method creates a custom job."""
96+
# test_client = vertexai.Client(project=_TEST_PROJECT, location=_TEST_LOCATION)
97+
# test_client.prompt_optimizer.optimize(
98+
# method="vapo",
99+
# config={
100+
# "config_path": "gs://ssusie-vapo-sdk-test/config.json",
101+
# "wait_for_completion": False,
102+
# },
103+
# )
104+
# mock_create_custom_job.assert_called_once()
105+
# mock_get_project_number.assert_called_once()

vertexai/_genai/client.py

Lines changed: 0 additions & 11 deletions
91C2
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,6 @@ def evals(self):
124124
) from e
125125
return self._evals.Evals(self._api_client)
126126

127-
@property
128-
@_common.experimental_warning(
129-
"The Vertex SDK GenAI prompt optimizer module is experimental, "
130-
"and may change in future versions."
131-
)
132-
def prompt_optimizer(self):
133-
self._prompt_optimizer = importlib.import_module(
134-
".prompt_optimizer", __package__
135-
)
136-
return self._prompt_optimizer.PromptOptimizer(self._api_client)
137-
138127
@property
139128
@_common.experimental_warning(
140129
"The Vertex SDK GenAI async client is experimental, "

0 commit comments

Comments
 (0)
0