Skip to content

Commit b146176

Browse files
Poggeccicopybara-github
authored andcommitted
feat: modularize fast_api.py to allow simpler construction of API Server
PiperOrigin-RevId: 783818634
1 parent 5edc493 commit b146176

14 files changed

+1319
-942
lines changed

src/google/adk/cli/adk_web_server.py

Lines changed: 999 additions & 0 deletions
Large diffs are not rendered by default.

src/google/adk/cli/agent_graph.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
import graphviz
2121

22-
from ..agents import BaseAgent
23-
from ..agents import LoopAgent
24-
from ..agents import ParallelAgent
25-
from ..agents import SequentialAgent
22+
from ..agents.base_agent import BaseAgent
2623
from ..agents.llm_agent import LlmAgent
24+
from ..agents.loop_agent import LoopAgent
25+
from ..agents.parallel_agent import ParallelAgent
26+
from ..agents.sequential_agent import SequentialAgent
2727
from ..tools.agent_tool import AgentTool
2828
from ..tools.base_tool import BaseTool
2929
from ..tools.function_tool import FunctionTool

src/google/adk/cli/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from ..sessions.in_memory_session_service import InMemorySessionService
3232
from ..sessions.session import Session
3333
from .utils import envs
34-
from .utils.agent_loader import AgentLoader
34+
from .utils.file_system_agent_loader import FileSystemAgentLoader
3535

3636

3737
class InputFile(BaseModel):
@@ -137,7 +137,7 @@ async def run_cli(
137137
session = await session_service.create_session(
138138
app_name=agent_folder_name, user_id=user_id
139139
)
140-
root_agent = AgentLoader(agents_dir=agent_parent_dir).load_agent(
140+
root_agent = FileSystemAgentLoader(agents_dir=agent_parent_dir).load_agent(
141141
agent_folder_name
142142
)
143143
envs.load_dotenv_for_agent(agent_folder_name, agent_parent_dir)

src/google/adk/cli/cli_eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from typing import Optional
2626
import uuid
2727

28-
from ..agents import Agent
28+
from ..agents.llm_agent import Agent
2929
from ..artifacts.base_artifact_service import BaseArtifactService
3030
from ..evaluation.constants import MISSING_EVAL_DEPENDENCIES_MESSAGE
3131
from ..evaluation.eval_case import EvalCase

0 commit comments

Comments
 (0)