mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
feat: Upgrade ADK stack to use App instead in addition to root_agent
The convention: - If some fields(like plugin) are defined both at root_agent and app, then a error will be raised. - app code should be located within agent.py. - an instance named app should be created PiperOrigin-RevId: 801084463
This commit is contained in:
committed by
Copybara-Service
parent
98b0426cd2
commit
a2e89a22a5
@@ -26,6 +26,7 @@ from typing import List
|
||||
from typing import Tuple
|
||||
|
||||
import click
|
||||
from google.adk.agents.base_agent import BaseAgent
|
||||
import google.adk.cli.cli as cli
|
||||
import pytest
|
||||
|
||||
@@ -130,12 +131,12 @@ async def test_run_input_file_outputs(
|
||||
artifact_service = cli.InMemoryArtifactService()
|
||||
session_service = cli.InMemorySessionService()
|
||||
credential_service = cli.InMemoryCredentialService()
|
||||
dummy_root = types.SimpleNamespace(name="root")
|
||||
dummy_root = BaseAgent(name="root")
|
||||
|
||||
session = await cli.run_input_file(
|
||||
app_name="app",
|
||||
user_id="user",
|
||||
root_agent=dummy_root,
|
||||
agent_or_app=dummy_root,
|
||||
artifact_service=artifact_service,
|
||||
session_service=session_service,
|
||||
credential_service=credential_service,
|
||||
@@ -205,7 +206,7 @@ async def test_run_interactively_whitespace_and_exit(
|
||||
sess = await session_service.create_session(app_name="dummy", user_id="u")
|
||||
artifact_service = cli.InMemoryArtifactService()
|
||||
credential_service = cli.InMemoryCredentialService()
|
||||
root_agent = types.SimpleNamespace(name="root")
|
||||
root_agent = BaseAgent(name="root")
|
||||
|
||||
# fake user input: blank -> 'hello' -> 'exit'
|
||||
answers = iter([" ", "hello", "exit"])
|
||||
|
||||
Reference in New Issue
Block a user