system-prompts-and-models-o.../dealix/auto_client_acquisition/model_router/task_router.py
Sami Assiri b13cb389cc feat(dealix): sync full Dealix package to repo
- API routers, ACA modules, integrations (draft operators)
- Docs, landing pages, scripts (launch readiness, scorecard)
- Tests and CI workflow updates for Dealix

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-01 21:01:17 +03:00

31 lines
1.6 KiB
Python

"""Map task types to suggested provider + cost class — deterministic."""
from __future__ import annotations
from typing import Any
_ROUTES: dict[str, dict[str, Any]] = {
"strategic_reasoning": {"provider": "anthropic", "cost_class": "high", "needs_guardrail": True},
"arabic_copywriting": {"provider": "anthropic", "cost_class": "medium", "needs_guardrail": True},
"classification": {"provider": "openai", "cost_class": "low", "needs_guardrail": True},
"compliance_guardrail": {"provider": "openai", "cost_class": "low", "needs_guardrail": False},
"meeting_analysis": {"provider": "google", "cost_class": "medium", "needs_guardrail": True},
"vision_analysis": {"provider": "google", "cost_class": "medium", "needs_guardrail": True},
"extraction": {"provider": "groq", "cost_class": "low", "needs_guardrail": True},
"summarization": {"provider": "openai", "cost_class": "low", "needs_guardrail": True},
"low_cost_bulk": {"provider": "groq", "cost_class": "minimal", "needs_guardrail": True},
"coding_project_understanding": {"provider": "anthropic", "cost_class": "high", "needs_guardrail": True},
}
def list_tasks() -> dict[str, Any]:
return {"task_types": sorted(_ROUTES.keys()), "demo": True}
def route_task(task_type: str) -> dict[str, Any]:
t = (task_type or "").strip().lower().replace("-", "_")
if t not in _ROUTES:
return {"ok": False, "error": "unknown_task_type", "known": sorted(_ROUTES.keys()), "demo": True}
r = _ROUTES[t]
return {"ok": True, "task_type": t, **r, "fallback_provider": "groq", "demo": True}