diff --git a/tests/unit/vertexai/genai/test_agent_engines.py b/tests/unit/vertexai/genai/test_agent_engines.py index 5da202dfb2..0fbdb6b53f 100644 --- a/tests/unit/vertexai/genai/test_agent_engines.py +++ b/tests/unit/vertexai/genai/test_agent_engines.py @@ -1263,7 +1263,7 @@ def test_create_agent_engine(self, mock_await_operation, mock_prepare, caplog): assert "View progress and logs at" in caplog.text assert "Agent Engine created. To use it in another session:" in caplog.text assert ( - f"agent_engine=client.agent_engines.get(" + f"agent_engine=client.agent_engines.get(name=" f"'{_TEST_AGENT_ENGINE_RESOURCE_NAME}')" in caplog.text ) @@ -1687,7 +1687,7 @@ def test_update_agent_engine_requirements( assert "Agent Engine updated. To use it in another session:" in caplog.text assert ( f"agent_engine=client.agent_engines.get(" - f"'{_TEST_AGENT_ENGINE_RESOURCE_NAME}')" in caplog.text + f"name='{_TEST_AGENT_ENGINE_RESOURCE_NAME}')" in caplog.text ) @mock.patch.object(_agent_engines_utils, "_prepare") diff --git a/vertexai/_genai/agent_engines.py b/vertexai/_genai/agent_engines.py index 3612c12d70..f5eecc853a 100644 --- a/vertexai/_genai/agent_engines.py +++ b/vertexai/_genai/agent_engines.py @@ -895,7 +895,7 @@ def create( if agent_engine.api_resource: logger.info("Agent Engine created. To use it in another session:") logger.info( - f"agent_engine=client.agent_engines.get('{agent_engine.api_resource.name}')" + f"agent_engine=client.agent_engines.get(name='{agent_engine.api_resource.name}')" ) elif operation.error: raise RuntimeError(f"Failed to create Agent Engine: {operation.error}") @@ -1313,7 +1313,7 @@ def update( if agent_engine.api_resource: logger.info("Agent Engine updated. To use it in another session:") logger.info( - f"agent_engine=client.agent_engines.get('{agent_engine.api_resource.name}')" + f"agent_engine=client.agent_engines.get(name='{agent_engine.api_resource.name}')" ) elif operation.error: raise RuntimeError(f"Failed to update Agent Engine: {operation.error}")