feat(agent-office): GET /agents/{id}/tasks에 task_type/days 필터 추가
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
from typing import Optional
|
||||||
from fastapi import FastAPI, HTTPException, WebSocket, WebSocketDisconnect
|
from fastapi import FastAPI, HTTPException, WebSocket, WebSocketDisconnect
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
|
|
||||||
@@ -104,8 +105,13 @@ def update_agent(agent_id: str, body: AgentConfigUpdate):
|
|||||||
return {"ok": True}
|
return {"ok": True}
|
||||||
|
|
||||||
@app.get("/api/agent-office/agents/{agent_id}/tasks")
|
@app.get("/api/agent-office/agents/{agent_id}/tasks")
|
||||||
def agent_tasks(agent_id: str, limit: int = 20):
|
def agent_tasks(
|
||||||
return {"tasks": get_agent_tasks(agent_id, limit)}
|
agent_id: str,
|
||||||
|
limit: int = 20,
|
||||||
|
task_type: Optional[str] = None,
|
||||||
|
days: Optional[int] = None,
|
||||||
|
):
|
||||||
|
return {"items": get_agent_tasks(agent_id, limit=limit, task_type=task_type, days=days)}
|
||||||
|
|
||||||
@app.get("/api/agent-office/agents/{agent_id}/logs")
|
@app.get("/api/agent-office/agents/{agent_id}/logs")
|
||||||
def agent_logs(agent_id: str, limit: int = 50):
|
def agent_logs(agent_id: str, limit: int = 50):
|
||||||
|
|||||||
Reference in New Issue
Block a user