Skip to content

Commit 004e15c

Browse files
yeesiancopybara-github
authored andcommitted
feat: Allow passthrough of GOOGLE_CLOUD_LOCATION for AgentEngine deployments
Co-authored-by: Yeesian Ng <ysian@google.com> PiperOrigin-RevId: 865013321
1 parent 574ec43 commit 004e15c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/google/adk/cli/cli_deploy.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -867,8 +867,12 @@ def to_agent_engine(
867867
absolutize_imports (bool): Optional. Default is True. Whether to absolutize
868868
imports. If True, all relative imports will be converted to absolute
869869
import statements.
870-
project (str): Optional. Google Cloud project id.
871-
region (str): Optional. Google Cloud region.
870+
project (str): Optional. Google Cloud project id for the deployed agent. If
871+
not specified, the project from the `GOOGLE_CLOUD_PROJECT` environment
872+
variable will be used. It will be ignored if `api_key` is specified.
873+
region (str): Optional. Google Cloud region for the deployed agent. If not
874+
specified, the region from the `GOOGLE_CLOUD_LOCATION` environment
875+
variable will be used. It will be ignored if `api_key` is specified.
872876
display_name (str): Optional. The display name of the Agent Engine.
873877
description (str): Optional. The description of the Agent Engine.
874878
requirements_file (str): Optional. The filepath to the `requirements.txt`
@@ -882,10 +886,9 @@ def to_agent_engine(
882886
to use. If not specified, the `.agent_engine_config.json` file in the
883887
`agent_folder` will be used.
884888
skip_agent_import_validation (bool): Optional. Default is True. If True,
885-
skip the
886-
pre-deployment import validation of `agent.py`. This can be useful when
887-
the local environment does not have the same dependencies as the
888-
deployment environment.
889+
skip the pre-deployment import validation of `agent.py`. This can be
890+
useful when the local environment does not have the same dependencies as
891+
the deployment environment.
889892
"""
890893
app_name = os.path.basename(agent_folder)
891894
display_name = display_name or app_name
@@ -1014,7 +1017,7 @@ def to_agent_engine(
10141017
project = env_project
10151018
click.echo(f'{project=} set by GOOGLE_CLOUD_PROJECT in {env_file}')
10161019
if 'GOOGLE_CLOUD_LOCATION' in env_vars:
1017-
env_region = env_vars.pop('GOOGLE_CLOUD_LOCATION')
1020+
env_region = env_vars.get('GOOGLE_CLOUD_LOCATION')
10181021
if env_region:
10191022
if region:
10201023
click.secho(

0 commit comments

Comments
 (0)