All checks were successful
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 47s
Test Suite / playwright-tests (push) Successful in 1m14s
- Implemented optional LLM-Rerank functionality in the planning exercise suggestion process, allowing for improved exercise ranking based on user-defined criteria. - Updated the `suggestPlanningExercises` API to accept `planned_exercise_ids` for client-side overrides, enhancing flexibility in exercise selection. - Enhanced the `ExercisePickerModal` to reflect LLM ranking status and support new planning context features. - Incremented application version to 0.8.170 and updated changelog to document the new features and improvements in the planning AI capabilities.
35 lines
1.4 KiB
Python
35 lines
1.4 KiB
Python
"""Tests für Planungs-Übungssuche (Intent, LLM-Rerank-Parser)."""
|
|
from planning_exercise_suggest import resolve_planning_exercise_intent
|
|
from planning_exercise_llm_rank import parse_planning_exercise_rank_response
|
|
|
|
|
|
def test_resolve_planning_exercise_intent_defaults():
|
|
assert resolve_planning_exercise_intent("", None) == "suggest_next"
|
|
assert resolve_planning_exercise_intent(" ", "suggest_next") == "suggest_next"
|
|
|
|
|
|
def test_resolve_planning_exercise_intent_keywords():
|
|
assert resolve_planning_exercise_intent("Vertiefung Partner", None) == "deepen_exercise"
|
|
assert resolve_planning_exercise_intent("nächste übung", None) == "suggest_next"
|
|
assert resolve_planning_exercise_intent("progression graph", None) == "progression_next"
|
|
|
|
|
|
def test_parse_planning_exercise_rank_response_filters_ids():
|
|
allowed = {10, 20, 30}
|
|
ranked, reasons = parse_planning_exercise_rank_response(
|
|
'{"ranked_ids":[20,999,20,10],"reasons":{"20":"Passt gut","999":"ignore"}}',
|
|
allowed,
|
|
)
|
|
assert ranked == [20, 10]
|
|
assert reasons[20] == "Passt gut"
|
|
assert 999 not in reasons
|
|
|
|
|
|
def test_parse_planning_exercise_rank_response_reasons_by_id_alias():
|
|
ranked, reasons = parse_planning_exercise_rank_response(
|
|
'{"ranked_ids":[5],"reasons_by_id":{"5":"Skill-Lücke"}}',
|
|
{5},
|
|
)
|
|
assert ranked == [5]
|
|
assert reasons[5] == "Skill-Lücke"
|