Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.123.0"
".": "1.122.0"
}
38 changes: 0 additions & 38 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,5 @@
# Changelog

## [1.123.0](https://github.com/googleapis/python-aiplatform/compare/v1.122.0...v1.123.0) (2025-10-29)


### Features

* Add initial support for Python v3.14 ([4618729](https://github.com/googleapis/python-aiplatform/commit/4618729e9b41163cda3056a3fde497a0c0d7178f))
* Add more attributes to OTel resource for ADK tracing ([5aaa60e](https://github.com/googleapis/python-aiplatform/commit/5aaa60e30a5695c2a5eb49283388fa36809e389e))
* Add Python 3.13 Kokoro run config ([57d2709](https://github.com/googleapis/python-aiplatform/commit/57d270909b02132296692b4adc6dbc89ee8de9c6))
* Add support for `app` input in AdkApp template ([10ca56f](https://github.com/googleapis/python-aiplatform/commit/10ca56f797f7c9cbfbe53e8830420135a58ac003))
* Add support of google-cloud-storage v3 dependency ([85cbb75](https://github.com/googleapis/python-aiplatform/commit/85cbb7532d1e8337b1747bce53c765a9b94d067a))
* Disable prompt/response content in ADK spans if telemetry env is set ([be5d1f5](https://github.com/googleapis/python-aiplatform/commit/be5d1f59121c5255e6061a518a5abe9e3e3c0a17))
* GenAI Client(evals) - Add agent data to EvaluationRun `show` in Vertex AI GenAI SDK evals ([d62afc3](https://github.com/googleapis/python-aiplatform/commit/d62afc32db85a103c25878dd82a338feb86f53fe))
* GenAI SDK client - add context management to AsyncClient ([8075e60](https://github.com/googleapis/python-aiplatform/commit/8075e6067a9ba924249155ec204488df97512ec8))
* GenAI SDK client - Enabling zero-shot prompt optimization for prompts from Android API by passing optimization_target=vertexai.types.OptimizeTarget.OPTIMIZATION_TARGET_GEMINI_NANO in the config ([92d8b2a](https://github.com/googleapis/python-aiplatform/commit/92d8b2a1659cc40c89a651c3a1b93ae5af5a9bf1))
* GenAI SDK client (Multimodal Dataset) - Create a multimodal dataset from Big Query. ([d4e211d](https://github.com/googleapis/python-aiplatform/commit/d4e211d00d3276aa6cb645deb27397467fc27c5b))
* GenAI SDK client(memory): Add extracted memories to MemoryRevision resources ([2267d58](https://github.com/googleapis/python-aiplatform/commit/2267d58f6ad849dcd4f0a2cce12e4bb1a06781eb))
* GenAI SDK client(memory): Add filter to RetrieveMemories ([2267d58](https://github.com/googleapis/python-aiplatform/commit/2267d58f6ad849dcd4f0a2cce12e4bb1a06781eb))
* GenAI SDK client(memory): Add Memory Topic labels to Memory ([de941a6](https://github.com/googleapis/python-aiplatform/commit/de941a6fc3ca7885a0fc3e42b5ef7c44a783963b))
* GenAI SDK client(multimodal) - Add get/update/list/delete to multimodal datasets. ([34996a2](https://github.com/googleapis/python-aiplatform/commit/34996a28de0495462aea9c7c2baf8b4249afb9df))
* GenAI SDK client(multimodal) - Add public get/update/delete methods to multimodal datasets. ([6737a70](https://github.com/googleapis/python-aiplatform/commit/6737a705d8a14023a0dce2902d62f34afb1bb763))
* Support Inline Source Deployment in Agent Engine ([9ae5f35](https://github.com/googleapis/python-aiplatform/commit/9ae5f356feef56d4ad652b9b6a705ce4f02079e7))


### Bug Fixes

* Allow both camelCase and snake_case in _StreamRunRequest ([6a6674d](https://github.com/googleapis/python-aiplatform/commit/6a6674d76bcd148ededfafd7d3f248d880c2b110))
* Clone agent_framework attribute in ModuleAgent.clone() ([81f8c40](https://github.com/googleapis/python-aiplatform/commit/81f8c406bb979f3521067b2dea1544db0f4194f4))
* GenAI Client(evals) - fix hallucination visualization ([a52da0b](https://github.com/googleapis/python-aiplatform/commit/a52da0b3d04c19e777ab8fff5d724c5cda8118f3))
* GenAI Client(evals) - fix visualization ([67f9099](https://github.com/googleapis/python-aiplatform/commit/67f9099af92226fac603c4cbec944e66c4fc737f))
* GenAI SDK client - Fix log showing how to get an Agent Engine. Positional arguments are not allowed. ([0fc74de](https://github.com/googleapis/python-aiplatform/commit/0fc74dea6d9e8826f29b7b9c1a10f348be911f6a))
* Remove unnecessary pandas import from multimodal datasets preview module. ([5dd51a2](https://github.com/googleapis/python-aiplatform/commit/5dd51a2ea6fa115ab8d33970d22aefaab31dfcbd))


### Documentation

* Add docstring for classes and fields that are not supported in Gemini or Vertex API ([cd99635](https://github.com/googleapis/python-aiplatform/commit/cd99635cd5b85334dbdfddd0ef3cb7ec5c93846d))
* Add docstring for enum classes that are not supported in Gemini or Vertex API ([db364ab](https://github.com/googleapis/python-aiplatform/commit/db364ab793cde5c25518bbaaa6df9a0f44ee9ac6))

## [1.122.0](https://github.com/googleapis/python-aiplatform/compare/v1.121.0...v1.122.0) (2025-10-21)


Expand Down
2 changes: 1 addition & 1 deletion google/cloud/aiplatform/gapic_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
2 changes: 1 addition & 1 deletion google/cloud/aiplatform/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# limitations under the License.
#

__version__ = "1.123.0"
__version__ = "1.122.0"
2 changes: 1 addition & 1 deletion google/cloud/aiplatform_v1/gapic_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
2 changes: 1 addition & 1 deletion google/cloud/aiplatform_v1beta1/gapic_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.123.0" # {x-release-please-version}
__version__ = "1.122.0" # {x-release-please-version}
2 changes: 1 addition & 1 deletion pypi/_vertex_ai_placeholder/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# limitations under the License.
#

__version__ = "1.123.0"
__version__ = "1.122.0"
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-aiplatform",
"version": "1.123.0"
"version": "1.122.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-aiplatform",
"version": "1.123.0"
"version": "1.122.0"
},
"snippets": [
{
Expand Down
32 changes: 8 additions & 24 deletions tests/unit/vertexai/genai/test_evals.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,7 @@ def test_run_inference_with_agent_engine_and_session_inputs_dict(
)

mock_agent_engine = mock.Mock()
mock_agent_engine.async_create_session = mock.AsyncMock(
return_value={"id": "session1"}
)
mock_agent_engine.create_session.return_value = {"id": "session1"}
stream_query_return_value = [
{
"id": "1",
Expand All @@ -1088,13 +1086,7 @@ def test_run_inference_with_agent_engine_and_session_inputs_dict(
},
]

async def _async_iterator(iterable):
for item in iterable:
yield item

mock_agent_engine.async_stream_query.return_value = _async_iterator(
stream_query_return_value
)
mock_agent_engine.stream_query.return_value = iter(stream_query_return_value)
mock_vertexai_client.return_value.agent_engines.get.return_value = (
mock_agent_engine
)
Expand All @@ -1108,10 +1100,10 @@ async def _async_iterator(iterable):
mock_vertexai_client.return_value.agent_engines.get.assert_called_once_with(
name="projects/test-project/locations/us-central1/reasoningEngines/123"
)
mock_agent_engine.async_create_session.assert_called_once_with(
mock_agent_engine.create_session.assert_called_once_with(
user_id="123", state={"a": "1"}
)
mock_agent_engine.async_stream_query.assert_called_once_with(
mock_agent_engine.stream_query.assert_called_once_with(
user_id="123", session_id="session1", message="agent prompt"
)

Expand Down Expand Up @@ -1162,9 +1154,7 @@ def test_run_inference_with_agent_engine_and_session_inputs_literal_string(
)

mock_agent_engine = mock.Mock()
mock_agent_engine.async_create_session = mock.AsyncMock(
return_value={"id": "session1"}
)
mock_agent_engine.create_session.return_value = {"id": "session1"}
stream_query_return_value = [
{
"id": "1",
Expand All @@ -1180,13 +1170,7 @@ def test_run_inference_with_agent_engine_and_session_inputs_literal_string(
},
]

async def _async_iterator(iterable):
for item in iterable:
yield item

mock_agent_engine.async_stream_query.return_value = _async_iterator(
stream_query_return_value
)
mock_agent_engine.stream_query.return_value = iter(stream_query_return_value)
mock_vertexai_client.return_value.agent_engines.get.return_value = (
mock_agent_engine
)
Expand All @@ -1200,10 +1184,10 @@ async def _async_iterator(iterable):
mock_vertexai_client.return_value.agent_engines.get.assert_called_once_with(
name="projects/test-project/locations/us-central1/reasoningEngines/123"
)
mock_agent_engine.async_create_session.assert_called_once_with(
mock_agent_engine.create_session.assert_called_once_with(
user_id="123", state={"a": "1"}
)
mock_agent_engine.async_stream_query.assert_called_once_with(
mock_agent_engine.stream_query.assert_called_once_with(
user_id="123", session_id="session1", message="agent prompt"
)

Expand Down
20 changes: 9 additions & 11 deletions vertexai/_genai/_evals_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,10 @@ def agent_run_wrapper(
and type(agent_engine).__name__ == "AgentEngine"
):
agent_engine_instance = agent_engine
return asyncio.run(
inference_fn_arg(
row=row_arg,
contents=contents_arg,
agent_engine=agent_engine_instance,
)
return inference_fn_arg(
row=row_arg,
contents=contents_arg,
agent_engine=agent_engine_instance,
)

future = executor.submit(
Expand Down Expand Up @@ -1265,7 +1263,7 @@ def _run_agent(
)


async def _execute_agent_run_with_retry(
def _execute_agent_run_with_retry(
row: pd.Series,
contents: Union[genai_types.ContentListUnion, genai_types.ContentListUnionDict],
agent_engine: types.AgentEngine,
Expand All @@ -1287,7 +1285,7 @@ async def _execute_agent_run_with_retry(
)
user_id = session_inputs.user_id
session_state = session_inputs.state
session = await agent_engine.async_create_session(
session = agent_engine.create_session(
user_id=user_id,
state=session_state,
)
Expand All @@ -1298,7 +1296,7 @@ async def _execute_agent_run_with_retry(
for attempt in range(max_retries):
try:
responses = []
async for event in agent_engine.async_stream_query(
for event in agent_engine.stream_query(
user_id=user_id,
session_id=session["id"],
message=contents,
Expand All @@ -1317,7 +1315,7 @@ async def _execute_agent_run_with_retry(
)
if attempt == max_retries - 1:
return {"error": f"Resource exhausted after retries: {e}"}
await asyncio.sleep(2**attempt)
time.sleep(2**attempt)
except Exception as e: # pylint: disable=broad-exception-caught
logger.error(
"Unexpected error during generate_content on attempt %d/%d: %s",
Expand All @@ -1328,7 +1326,7 @@ async def _execute_agent_run_with_retry(

if attempt == max_retries - 1:
return {"error": f"Failed after retries: {e}"}
await asyncio.sleep(1)
time.sleep(1)
return {"error": f"Failed to get agent run results after {max_retries} retries"}


Expand Down
Loading