All checks were successful
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 40s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m13s
- Incremented version to 0.8.185, reflecting the implementation of Phase C3 features. - Introduced the `POST /api/planning/progression-path-suggest` endpoint for generating exercise progression paths. - Enhanced the ExerciseProgressionGraphPanel with a new ExerciseProgressionPathBuilder for reviewing and saving paths. - Updated changelog to document the new capabilities in planning AI functionality.
32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
"""
|
|
POST /api/planning/exercise-suggest — planungsgebundene Übungssuche (Hybrid + Profil + optional LLM-Rerank).
|
|
"""
|
|
from fastapi import APIRouter, Depends
|
|
|
|
from db import get_db, get_cursor
|
|
from tenant_context import TenantContext, get_tenant_context
|
|
from planning_exercise_suggest import PlanningExerciseSuggestRequest, suggest_planning_exercises
|
|
from planning_exercise_path_builder import ProgressionPathSuggestRequest, suggest_progression_path
|
|
|
|
router = APIRouter(prefix="/api/planning", tags=["planning_exercise_suggest"])
|
|
|
|
|
|
@router.post("/exercise-suggest")
|
|
def post_planning_exercise_suggest(
|
|
body: PlanningExerciseSuggestRequest,
|
|
tenant: TenantContext = Depends(get_tenant_context),
|
|
):
|
|
with get_db() as conn:
|
|
cur = get_cursor(conn)
|
|
return suggest_planning_exercises(cur, tenant=tenant, body=body)
|
|
|
|
|
|
@router.post("/progression-path-suggest")
|
|
def post_progression_path_suggest(
|
|
body: ProgressionPathSuggestRequest,
|
|
tenant: TenantContext = Depends(get_tenant_context),
|
|
):
|
|
with get_db() as conn:
|
|
cur = get_cursor(conn)
|
|
return suggest_progression_path(cur, tenant=tenant, body=body)
|