Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
find_repo_root,
)
from .catalog import CustomCatalogConfig, A2uiCatalog
from ...extension.a2ui_extension import INLINE_CATALOGS_KEY, SUPPORTED_CATALOG_IDS_KEY
from ...extension.a2ui_extension import INLINE_CATALOGS_KEY, SUPPORTED_CATALOG_IDS_KEY, get_a2ui_agent_extension
from a2a.types import AgentExtension


def _load_basic_component(version: str, spec_name: str) -> Dict:
Expand Down Expand Up @@ -322,3 +323,7 @@ def generate_system_prompt(
parts.append(f"### Examples:\n{examples_str}")

return "\n\n".join(parts)

def get_agent_extension(self) -> AgentExtension:
catalog_ids = self._supported_catalogs.keys()
return get_a2ui_agent_extension(supported_catalog_ids=list(catalog_ids))
36 changes: 4 additions & 32 deletions samples/agent/adk/contact_lookup/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
from a2a.server.apps import A2AStarletteApplication
from a2a.server.request_handlers import DefaultRequestHandler
from a2a.server.tasks import InMemoryTaskStore
from a2a.types import AgentCapabilities, AgentCard, AgentSkill
from a2ui.extension.a2ui_extension import get_a2ui_agent_extension
from agent import ContactAgent
from agent_executor import ContactAgentExecutor
from dotenv import load_dotenv
Expand Down Expand Up @@ -50,44 +48,18 @@ def main(host, port):
" is not TRUE."
)

capabilities = AgentCapabilities(
streaming=True,
extensions=[get_a2ui_agent_extension()],
)
skill = AgentSkill(
id="find_contact",
name="Find Contact Tool",
description=(
"Helps find contact information for colleagues (e.g., email, location,"
" team)."
),
tags=["contact", "directory", "people", "finder"],
examples=["Who is David Chen in marketing?", "Find Sarah Lee from engineering"],
)

base_url = f"http://{host}:{port}"
ui_agent = ContactAgent(base_url=base_url, use_ui=True)
text_agent = ContactAgent(base_url=base_url, use_ui=False)

agent_card = AgentCard(
name="Contact Lookup Agent",
description=(
"This agent helps find contact info for people in your organization."
),
url=base_url, # <-- Use base_url here
version="1.0.0",
default_input_modes=ContactAgent.SUPPORTED_CONTENT_TYPES,
default_output_modes=ContactAgent.SUPPORTED_CONTENT_TYPES,
capabilities=capabilities,
skills=[skill],
)

agent_executor = ContactAgentExecutor(base_url=base_url)
agent_executor = ContactAgentExecutor(ui_agent=ui_agent, text_agent=text_agent)

request_handler = DefaultRequestHandler(
agent_executor=agent_executor,
task_store=InMemoryTaskStore(),
)
server = A2AStarletteApplication(
agent_card=agent_card, http_handler=request_handler
agent_card=ui_agent.get_agent_card(), http_handler=request_handler
)
import uvicorn

Expand Down
162 changes: 0 additions & 162 deletions samples/agent/adk/contact_lookup/a2ui_examples.py

This file was deleted.

Loading
Loading