diff --git a/contributing/samples/gepa/experiment.py b/contributing/samples/gepa/experiment.py index 2f5d03a772..f68b349d9c 100644 --- a/contributing/samples/gepa/experiment.py +++ b/contributing/samples/gepa/experiment.py @@ -43,7 +43,6 @@ from tau_bench.types import EnvRunResult from tau_bench.types import RunConfig import tau_bench_agent as tau_bench_agent_lib - import utils diff --git a/contributing/samples/gepa/run_experiment.py b/contributing/samples/gepa/run_experiment.py index cfd850b3a3..1bc4ee58c8 100644 --- a/contributing/samples/gepa/run_experiment.py +++ b/contributing/samples/gepa/run_experiment.py @@ -25,7 +25,6 @@ from absl import flags import experiment from google.genai import types - import utils _OUTPUT_DIR = flags.DEFINE_string( diff --git a/src/google/adk/cli/cli_deploy.py b/src/google/adk/cli/cli_deploy.py index 45dce7fda6..e2c47770f3 100644 --- a/src/google/adk/cli/cli_deploy.py +++ b/src/google/adk/cli/cli_deploy.py @@ -707,6 +707,7 @@ def to_agent_engine( to use. If not specified, the `.agent_engine_config.json` file in the `agent_folder` will be used. """ + ADK_APP_OBJECT_NAME = 'adk_app' app_name = os.path.basename(agent_folder) display_name = display_name or app_name parent_folder = os.path.dirname(agent_folder) @@ -863,6 +864,22 @@ def to_agent_engine( return click.echo('Vertex AI initialized.') + click.echo(f'Using adk_app: {adk_app}') + + if not os.path.exists(os.path.join(agent_src_path, f'{adk_app}.py')): + adk_app_file = os.path.join(temp_folder, f'{adk_app}.py') + with open(adk_app_file, 'w', encoding='utf-8') as f: + f.write( + _AGENT_ENGINE_APP_TEMPLATE.format( + app_name=app_name, + trace_to_cloud_option=trace_to_cloud, + ) + ) + click.echo(f'Created {adk_app_file}') + else: + shutil.copy(os.path.join(agent_src_path, f'{adk_app}.py'), temp_folder) + click.echo(f'Using existing {adk_app}.py') + is_config_agent = False config_root_agent_file = os.path.join(agent_src_path, 'root_agent.yaml') if os.path.exists(config_root_agent_file): diff --git a/src/google/adk/cli/cli_tools_click.py b/src/google/adk/cli/cli_tools_click.py index 5d228f72f3..1b9411bba6 100644 --- a/src/google/adk/cli/cli_tools_click.py +++ b/src/google/adk/cli/cli_tools_click.py @@ -1582,8 +1582,8 @@ def cli_deploy_cloud_run( type=str, default="agent_engine_app", help=( - "Optional. Python file for defining the ADK application" - " (default: a file named agent_engine_app.py)" + "Optional. The module name (without .py) for the Python file defining" + " the ADK Application (default: 'agent_engine_app')." ), ) @click.option(