Cron-triggered endpoint that uses Claude to auto-categorize uncategorized bookmarks. Includes full project documentation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 lines
379 B
Python
13 lines
379 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from app.categorizer import categorize_pending
|
|
from app.database import get_db
|
|
|
|
router = APIRouter(tags=["categorize"])
|
|
|
|
|
|
@router.post("/api/categorize")
|
|
async def run_categorize(db: AsyncSession = Depends(get_db)):
|
|
count = await categorize_pending(db)
|
|
return {"categorized": count}
|