Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/google/adk/cli/cli_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,15 @@ def _print_agent_engine_url(resource_name: str) -> None:
)


def _print_gemini_enterprise_hint() -> None:
"""Prints a pointer to the Gemini Enterprise registration docs."""
click.secho(
'To make this agent available in Gemini Enterprise, register it by'
' following:\nhttps://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent\n',
fg='cyan',
)


def to_agent_engine(
*,
agent_folder: str,
Expand Down Expand Up @@ -1302,6 +1311,7 @@ def create_dockerfile_for_agent_engine(resource_name: str) -> None:
click.secho(f'Cleaned up the instance: {resource_name}', fg='green')
raise e
_print_agent_engine_url(resource_name)
_print_gemini_enterprise_hint()
finally:
temp_folder_path = os.path.join(parent_folder, temp_folder)
click.echo(f'Cleaning up the temp folder: {temp_folder_path}')
Expand Down
13 changes: 13 additions & 0 deletions tests/unittests/cli/utils/test_cli_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,19 @@ def test_print_agent_engine_url() -> None:
assert "playground" in call_args


def test_print_gemini_enterprise_hint() -> None:
"""It should print a pointer to the Gemini Enterprise registration docs."""
with mock.patch("click.secho") as mocked_secho:
cli_deploy._print_gemini_enterprise_hint()
mocked_secho.assert_called_once()
call_args = mocked_secho.call_args[0][0]
assert "Gemini Enterprise" in call_args
assert (
"https://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent"
in call_args
)


@pytest.mark.parametrize("include_requirements", [True, False])
def test_to_agent_engine_happy_path(
monkeypatch: pytest.MonkeyPatch,
Expand Down