feat: Allow user to edit agent files/directories and apply changes without reloading anything

PiperOrigin-RevId: 780710003
This commit is contained in:
Ariz Chang
2025-07-08 14:14:31 -07:00
committed by Copybara-Service
parent e33161b4f8
commit e545e5a570
4 changed files with 61 additions and 1 deletions
+12
View File
@@ -583,6 +583,13 @@ def fast_api_common_options():
default=False,
help="Optional. Whether to enable A2A endpoint.",
)
@click.option(
"--reload_agents",
is_flag=True,
default=False,
show_default=True,
help="Optional. Whether to enable live reload for agents changes.",
)
@functools.wraps(func)
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
@@ -625,6 +632,7 @@ def cli_web(
session_db_url: Optional[str] = None, # Deprecated
artifact_storage_uri: Optional[str] = None, # Deprecated
a2a: bool = False,
reload_agents: bool = False,
):
"""Starts a FastAPI server with Web UI for agents.
@@ -674,6 +682,7 @@ def cli_web(
a2a=a2a,
host=host,
port=port,
reload_agents=reload_agents,
)
config = uvicorn.Config(
app,
@@ -721,6 +730,7 @@ def cli_api_server(
session_db_url: Optional[str] = None, # Deprecated
artifact_storage_uri: Optional[str] = None, # Deprecated
a2a: bool = False,
reload_agents: bool = False,
):
"""Starts a FastAPI server for agents.
@@ -748,6 +758,7 @@ def cli_api_server(
a2a=a2a,
host=host,
port=port,
reload_agents=reload_agents,
),
host=host,
port=port,
@@ -861,6 +872,7 @@ def cli_deploy_cloud_run(
session_db_url: Optional[str] = None, # Deprecated
artifact_storage_uri: Optional[str] = None, # Deprecated
a2a: bool = False,
reload_agents: bool = False,
):
"""Deploys an agent to Cloud Run.