e4dcfc49aa
Tests / Import Check (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.14) (push) Has been cancelled
Tests / Python Tests (Python 3.11) (push) Has been cancelled
Tests / Python Tests (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.14) (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Tests / Lint and Format (push) Has been cancelled
Tests / Web Node Tests (push) Has been cancelled
Tests / Import Check (Python 3.11) (push) Has been cancelled
Tests / Import Check (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.13) (push) Has been cancelled
60 lines
1.3 KiB
Python
60 lines
1.3 KiB
Python
#!/usr/bin/env python
|
|
"""
|
|
Agent Configuration API - Provides agent metadata for data-driven UI.
|
|
"""
|
|
|
|
from fastapi import APIRouter
|
|
|
|
router = APIRouter()
|
|
|
|
# Agent registry - single source of truth for agent UI metadata
|
|
AGENT_REGISTRY = {
|
|
"solve": {
|
|
"icon": "HelpCircle",
|
|
"color": "blue",
|
|
"label_key": "Problem Solved",
|
|
},
|
|
"question": {
|
|
"icon": "FileText",
|
|
"color": "purple",
|
|
"label_key": "Question Generated",
|
|
},
|
|
"research": {
|
|
"icon": "Search",
|
|
"color": "emerald",
|
|
"label_key": "Research Report",
|
|
},
|
|
"co_writer": {
|
|
"icon": "PenTool",
|
|
"color": "amber",
|
|
"label_key": "Co-Writer",
|
|
},
|
|
}
|
|
|
|
|
|
@router.get("/agents")
|
|
async def get_agent_config():
|
|
"""
|
|
Get agent UI configuration.
|
|
|
|
Returns:
|
|
Dict mapping agent type to UI metadata (icon, color, label_key)
|
|
"""
|
|
return AGENT_REGISTRY
|
|
|
|
|
|
@router.get("/agents/{agent_type}")
|
|
async def get_single_agent_config(agent_type: str):
|
|
"""
|
|
Get UI configuration for a specific agent.
|
|
|
|
Args:
|
|
agent_type: Agent type (solve, question, research, etc.)
|
|
|
|
Returns:
|
|
Agent UI metadata or 404 if not found
|
|
"""
|
|
if agent_type in AGENT_REGISTRY:
|
|
return AGENT_REGISTRY[agent_type]
|
|
return {"error": f"Agent type '{agent_type}' not found"}
|