Skip to content

Commit 83d7bb6

Browse files
yeesiancopybara-github
authored andcommitted
fix: Use the correct path for config-based agents when deploying to AgentEngine
Co-authored-by: Yeesian Ng <ysian@google.com> PiperOrigin-RevId: 856724694
1 parent 19555e7 commit 83d7bb6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/google/adk/cli/cli_deploy.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,7 @@
7474
7575
if {is_config_agent}:
7676
from google.adk.agents import config_agent_utils
77-
try:
78-
# This path is for local loading.
79-
root_agent = config_agent_utils.from_config("{agent_folder}/root_agent.yaml")
80-
except FileNotFoundError:
81-
# This path is used to support the file structure in Agent Engine.
82-
root_agent = config_agent_utils.from_config("./{temp_folder}/{app_name}/root_agent.yaml")
77+
root_agent = config_agent_utils.from_config("{agent_folder}/root_agent.yaml")
8378
else:
8479
from .agent import {adk_app_object}
8580
@@ -912,8 +907,7 @@ def to_agent_engine(
912907
app_name=app_name,
913908
trace_to_cloud_option=trace_to_cloud,
914909
is_config_agent=is_config_agent,
915-
temp_folder=temp_folder,
916-
agent_folder=agent_folder,
910+
agent_folder=f'./{temp_folder}',
917911
adk_app_object=adk_app_object,
918912
adk_app_type=adk_app_type,
919913
express_mode=api_key is not None,

0 commit comments

Comments
 (0)