diff --git a/app/api/routes/agents.py b/app/api/routes/agents.py index 65844de..fbb8cc0 100644 --- a/app/api/routes/agents.py +++ b/app/api/routes/agents.py @@ -49,12 +49,19 @@ def _dt_ms_opt(dt: datetime | None) -> int | None: def _to_data_types(values: list[str]) -> list[str]: normalize = { - "task": "tasks", - "note": "notes", - "timeline": "timelines", - "project": "projects", + "task": "tasks", "tasks": "tasks", + "note": "notes", "notes": "notes", + "timeline": "timelines", "timelines": "timelines", "timelineEvents": "timelines", + "project": "projects", "projects": "projects", } - return [normalize[v] for v in values if v in normalize] + seen: set[str] = set() + result: list[str] = [] + for v in values: + mapped = normalize.get(v) + if mapped and mapped not in seen: + seen.add(mapped) + result.append(mapped) + return result def _to_run_log_response(log: AgentRunLog) -> AgentRunLogResponse: diff --git a/app/schemas.py b/app/schemas.py index e4399ec..3e8a034 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -295,11 +295,8 @@ class AgentCreationCheckResponse(BaseModel): class AgentTriggerRequest(BaseModel): directory: str = Field(min_length=1) device_id: str = Field(default="") - what_to_extract: list[Literal["task", "note", "timeline", "project"]] = Field(min_length=1) - actions_by_type: dict[ - Literal["task", "note", "timeline", "project"], - list[Literal["add", "update"]], - ] | None = None + what_to_extract: list[str] = Field(min_length=1) + actions_by_type: dict[str, list[str]] | None = None batch_interval: str = Field(min_length=1) custom_agent_prompt: str = Field(min_length=1) active_agents: int = Field(ge=0, default=0)