feat: Agent Office — AI 에이전트 가상 오피스 (#2)
## Summary - 2D 픽셀아트 가상 오피스에서 AI 에이전트(Stock, Music)가 실제 작업 수행 - FastAPI + WebSocket 실시간 상태 동기화 + 텔레그램 봇 양방향 알림/승인 - BaseAgent FSM (idle/working/waiting/reporting/break), 서비스 프록시 패턴 - Docker Compose 서비스 (port 18900) + Nginx WebSocket 프록시 ## Changes (13 commits) - Backend scaffold: config, db, models, Dockerfile - WebSocket manager + Service proxy - BaseAgent FSM + StockAgent + MusicAgent - Telegram bot + Scheduler - FastAPI main (REST + WS endpoints) - Infrastructure: docker-compose + nginx - Code review fixes: HTTPException, async polling, input validation Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
20
agent-office/app/scheduler.py
Normal file
20
agent-office/app/scheduler.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import asyncio
|
||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||
|
||||
from .agents import AGENT_REGISTRY
|
||||
|
||||
scheduler = AsyncIOScheduler(timezone="Asia/Seoul")
|
||||
|
||||
async def _check_idle_breaks():
|
||||
for agent in AGENT_REGISTRY.values():
|
||||
await agent.check_idle_break()
|
||||
|
||||
async def _run_stock_schedule():
|
||||
agent = AGENT_REGISTRY.get("stock")
|
||||
if agent:
|
||||
await agent.on_schedule()
|
||||
|
||||
def init_scheduler():
|
||||
scheduler.add_job(_run_stock_schedule, "cron", hour=8, minute=0, id="stock_news")
|
||||
scheduler.add_job(_check_idle_breaks, "interval", seconds=60, id="idle_check")
|
||||
scheduler.start()
|
||||
Reference in New Issue
Block a user