fix: fix agent config path handling in generated deployment script

The generated agent deployment script now uses os.path.join and os.path.dirname(__file__) to construct the path to root_agent.yaml. This prevents issues where backslashes in Windows paths could be misinterpreted as Python escape sequences within the f-string, leading to syntax error

Close #4223

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 860236820
This commit is contained in:
George Weale
2026-01-23 13:39:32 -08:00
committed by Copybara-Service
parent 025b42c836
commit 801233902b
2 changed files with 15 additions and 1 deletions
+2 -1
View File
@@ -105,7 +105,8 @@ from vertexai.agent_engines import AdkApp
if {is_config_agent}:
from google.adk.agents import config_agent_utils
root_agent = config_agent_utils.from_config("{agent_folder}/root_agent.yaml")
config_path = os.path.join(os.path.dirname(__file__), "root_agent.yaml")
root_agent = config_agent_utils.from_config(config_path)
else:
from .agent import {adk_app_object}