Skip to content
This repository was archived by the owner on Oct 1, 2026. It is now read-only.
Merged
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
6 changes: 6 additions & 0 deletions gradient_adk/cli/agent/deployment/deploy_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ async def deploy_agent(
source_dir: Path,
project_id: str,
api_token: str,
region: str | None = None,
) -> None:
"""Deploy the agent to the configured environment."""
...
Expand Down Expand Up @@ -86,6 +87,7 @@ async def deploy_agent(
project_id: str,
api_token: str,
description: str | None = None,
region: str | None = None,
) -> str:
"""Deploy an agent to the platform.

Expand Down Expand Up @@ -139,6 +141,7 @@ async def deploy_agent(
code_artifact=code_artifact,
project_id=project_id,
description=description,
region=region,
)

# Poll for deployment completion
Expand Down Expand Up @@ -319,6 +322,7 @@ async def _create_or_update_deployment(
code_artifact: AgentDeploymentCodeArtifact,
project_id: str,
description: str | None = None,
region: str | None = None,
) -> str:
"""Create or update the deployment based on what exists.

Expand All @@ -344,6 +348,7 @@ async def _create_or_update_deployment(
project_id=project_id,
library_version=_get_adk_version(),
description=description,
region=region,
)
workspace_output = await self.client.create_agent_workspace(workspace_input)

Expand Down Expand Up @@ -371,6 +376,7 @@ async def _create_or_update_deployment(
agent_deployment_code_artifact=code_artifact,
library_version=_get_adk_version(),
description=description,
region=region,
)
deployment_output = await self.client.create_agent_workspace_deployment(
deployment_input
Expand Down
4 changes: 3 additions & 1 deletion gradient_adk/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,9 @@ async def deploy():
)
raise typer.Exit(1)

# Get description from config (optional)
# Get optional config values
description = _agent_config_manager.get_description()
region = _agent_config_manager.get_region()

# Load .gradientignore patterns and create deploy service
exclude_patterns = load_gradientignore(Path.cwd())
Expand All @@ -487,6 +488,7 @@ async def deploy():
project_id=project_id,
api_token=api_token,
description=description,
region=region,
)

invoke_url = f"https://agents.do-ai.run/v1/{workspace_uuid}/{agent_deployment_name}/run"
Expand Down
3 changes: 3 additions & 0 deletions gradient_adk/cli/config/agent_config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def get_entrypoint_file(self) -> Optional[str]:
def get_description(self) -> Optional[str]:
raise NotImplementedError

def get_region(self) -> Optional[str]:
raise NotImplementedError

def configure(
self,
agent_name: Optional[str] = None,
Expand Down
12 changes: 10 additions & 2 deletions gradient_adk/cli/config/yaml_agent_config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@ def get_description(self) -> Optional[str]:
config = self.load_config()
return config.get("description") if config else None

def get_region(self) -> Optional[str]:
config = self.load_config()
return config.get("region") if config else None

def configure(
self,
agent_name: Optional[str] = None,
agent_environment: Optional[str] = None,
entrypoint_file: Optional[str] = None,
description: Optional[str] = None,
region: Optional[str] = None,
interactive: bool = True,
) -> None:
"""Configure agent settings and save to YAML file."""
Expand Down Expand Up @@ -107,7 +112,7 @@ def configure(
raise typer.Exit(1)

self._validate_entrypoint_file(entrypoint_file)
self._save_config(agent_name, agent_environment, entrypoint_file, description)
self._save_config(agent_name, agent_environment, entrypoint_file, description, region)

def _validate_name(self, name: str) -> bool:
"""Validate that a name only contains alphanumeric characters, hyphens, and underscores."""
Expand Down Expand Up @@ -178,6 +183,7 @@ def _save_config(
agent_environment: str,
entrypoint_file: str,
description: Optional[str] = None,
region: Optional[str] = None,
) -> None:
"""Save configuration to YAML file."""
config = {
Expand All @@ -186,10 +192,12 @@ def _save_config(
"entrypoint_file": entrypoint_file,
}

# Only include description if provided
if description is not None:
config["description"] = description

if region is not None:
config["region"] = region

try:
with open(self.config_file, "w") as f:
yaml.safe_dump(config, f, default_flow_style=False)
Expand Down
6 changes: 6 additions & 0 deletions gradient_adk/digital_ocean_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,9 @@ class CreateAgentWorkspaceDeploymentInput(BaseModel):
library_version: Optional[str] = Field(
None, description="Version of the ADK library used to create this deployment"
)
region: Optional[str] = Field(
None, description="The region to deploy the agent in"
)
description: Optional[str] = Field(
None,
description="Description of the agent deployment (max 1000 characters)",
Expand Down Expand Up @@ -543,6 +546,9 @@ class CreateAgentWorkspaceInput(BaseModel):
library_version: Optional[str] = Field(
None, description="Version of the ADK library used to create this workspace"
)
region: Optional[str] = Field(
None, description="The region to deploy the agent in"
)
description: Optional[str] = Field(
None,
description="Description of the agent workspace deployment (max 1000 characters)",
Expand Down
Loading