Skip to content
This repository was archived by the owner on Oct 1, 2026. It is now read-only.
Merged
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
11 changes: 9 additions & 2 deletions gradient_adk/cli/agent/deployment/deploy_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ def _get_adk_version() -> str:
return "unknown"


def _region_to_proto_enum(region: str | None) -> str | None:
"""Convert a short region string to the proto enum name expected by the API."""
if not region or not region.strip():
return None
return f"AGENT_WORKSPACE_DEPLOYMENT_REGION_{region.strip().upper()}"


class DeployService(Protocol):
"""Protocol for agent deployment operations."""

Expand Down Expand Up @@ -348,7 +355,7 @@ async def _create_or_update_deployment(
project_id=project_id,
library_version=_get_adk_version(),
description=description,
region=region,
region=_region_to_proto_enum(region),
)
workspace_output = await self.client.create_agent_workspace(workspace_input)

Expand Down Expand Up @@ -376,7 +383,7 @@ async def _create_or_update_deployment(
agent_deployment_code_artifact=code_artifact,
library_version=_get_adk_version(),
description=description,
region=region,
region=_region_to_proto_enum(region),
)
deployment_output = await self.client.create_agent_workspace_deployment(
deployment_input
Expand Down
Loading