Skip to content

Commit 81f8c40

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
fix: clone agent_framework attribute in ModuleAgent.clone()
This will for example allow to correctly set reasoning_engine.spec.agent_framework to "google-adk" with `adk deploy` command. PiperOrigin-RevId: 823682009
1 parent d62afc3 commit 81f8c40

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

tests/unit/vertex_langchain/test_agent_engine_templates_module.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def test_clone(self):
5959
agent_name=_TEST_AGENT_NAME,
6060
register_operations=_TEST_REGISTER_OPERATIONS,
6161
sys_paths=[_TEST_SYS_PATH],
62+
agent_framework="my_framework",
6263
)
6364
agent.set_up()
6465
assert agent._tmpl_attrs.get("agent") is not None
@@ -67,6 +68,7 @@ def test_clone(self):
6768
assert agent._tmpl_attrs.get("agent") is not None
6869
assert agent_clone._tmpl_attrs.get("agent") is None
6970
assert agent_clone._tmpl_attrs.get("sys_paths") == [_TEST_SYS_PATH]
71+
assert agent_clone.agent_framework == "my_framework"
7072
agent_clone.set_up()
7173
assert agent_clone._tmpl_attrs.get("agent") is not None
7274

vertexai/agent_engines/_agent_engines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ def clone(self):
279279
agent_name=self._tmpl_attrs.get("agent_name"),
280280
register_operations=self._tmpl_attrs.get("register_operations"),
281281
sys_paths=self._tmpl_attrs.get("sys_paths"),
282+
agent_framework=self.agent_framework,
282283
)
283284

284285
def register_operations(self, **kwargs) -> Dict[str, Sequence[str]]:

0 commit comments

Comments
 (0)