Добавить FastAPI endpoint запуска сценария через AgentOS base_app.
Подключен верхний HTTP-слой с POST /api/runs и обновлены схемы/README, чтобы запуск сценариев шел через единый API-контракт поверх Agno workflow.
This commit is contained in:
+9
-1
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any, Literal
|
||||
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class RunError(BaseModel):
|
||||
@@ -10,6 +10,11 @@ class RunError(BaseModel):
|
||||
message: str
|
||||
|
||||
|
||||
class ScenarioRunRequest(BaseModel):
|
||||
scenario_id: str = "news_source_discovery_v1"
|
||||
input: dict[str, Any] = Field(default_factory=dict)
|
||||
|
||||
|
||||
class ScenarioRunBase(BaseModel):
|
||||
scenario_id: str
|
||||
status: Literal["success", "failed"]
|
||||
@@ -29,3 +34,6 @@ class ScenarioRunSuccess(ScenarioRunBase):
|
||||
result: dict[str, Any]
|
||||
run_id: str | None = None
|
||||
session_id: str | None = None
|
||||
|
||||
|
||||
ScenarioRunResponse = ScenarioRunSuccess | ScenarioRunFailed
|
||||
|
||||
Reference in New Issue
Block a user