Добавить FastAPI endpoint запуска сценария через AgentOS base_app.

Подключен верхний HTTP-слой с POST /api/runs и обновлены схемы/README, чтобы запуск сценариев шел через единый API-контракт поверх Agno workflow.
This commit is contained in:
Barabashka
2026-04-21 17:37:36 +03:00
parent d341941f87
commit 0fbd7dce1a
4 changed files with 73 additions and 3 deletions
+17
View File
@@ -0,0 +1,17 @@
from fastapi import APIRouter
from pydantic import TypeAdapter
from src.schemas import ScenarioRunRequest, ScenarioRunResponse
from src.workflow_runner import run_scenario_workflow
router = APIRouter(prefix="/api", tags=["workflow"])
_run_response_adapter = TypeAdapter(ScenarioRunResponse)
@router.post("/runs", response_model=ScenarioRunResponse)
async def run_scenario(request: ScenarioRunRequest) -> ScenarioRunResponse:
result = await run_scenario_workflow(
input_data=request.input,
scenario_id=request.scenario_id,
)
return _run_response_adapter.validate_python(result)