Wires circuitforge_core.tasks.scheduler into Snipe. Adds trust_photo_analysis background task: downloads primary listing photo, calls LLMRouter with vision capability, writes result to trust_scores.photo_analysis_json (Paid tier). photo_analysis_json column already existed in 001_init.sql migration.
23 lines
689 B
Python
23 lines
689 B
Python
# app/tasks/scheduler.py
|
|
"""Snipe LLM/vision task scheduler — thin shim over circuitforge_core.tasks.scheduler."""
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from circuitforge_core.tasks.scheduler import (
|
|
TaskScheduler,
|
|
get_scheduler as _base_get_scheduler,
|
|
reset_scheduler, # re-export for tests
|
|
)
|
|
|
|
from app.tasks.runner import LLM_TASK_TYPES, VRAM_BUDGETS, run_task
|
|
|
|
|
|
def get_scheduler(db_path: Path) -> TaskScheduler:
|
|
"""Return the process-level TaskScheduler singleton for Snipe."""
|
|
return _base_get_scheduler(
|
|
db_path=db_path,
|
|
run_task_fn=run_task,
|
|
task_types=LLM_TASK_TYPES,
|
|
vram_budgets=VRAM_BUDGETS,
|
|
)
|