Implement Planning Context Integration for Exercise AI Suggestions
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 33s
Test Suite / playwright-tests (push) Successful in 1m13s
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 33s
Test Suite / playwright-tests (push) Successful in 1m13s
- Added `planning_context` to the `suggestExerciseAi` endpoint, enabling structured planning context for new exercise creation. - Updated relevant components and backend logic to handle the new planning context, enhancing the AI's exercise suggestion capabilities. - Incremented application version to 0.8.208 to reflect these changes.
This commit is contained in:
1 parent
f074a8bef0
commit
779e2477ba
14 files changed
+503
-9
No files matched your search
+18
-1
@@ -650,10 +650,13 @@ def build_exercise_placeholder_variables(
|
||||
focus_areas_context: Optional[Sequence[Tuple[int, bool]]],
|
||||
preparation: Optional[str] = None,
|
||||
trainer_notes: Optional[str] = None,
|
||||
planning_context: Optional[Mapping[str, Any]] = None,
|
||||
) -> Dict[str, str]:
|
||||
"""
|
||||
Baut die Variable-Map fuer {{platzhalter}} passend zur Slug fuer Uebungs-KI.
|
||||
"""
|
||||
from planning_exercise_form_context import planning_context_prompt_variables
|
||||
|
||||
s = (slug or "").strip().lower()
|
||||
if s == "pipeline":
|
||||
return {}
|
||||
@@ -671,8 +674,19 @@ def build_exercise_placeholder_variables(
|
||||
"exercise_preparation": p_plain or "-",
|
||||
"exercise_trainer_notes": n_plain or "-",
|
||||
}
|
||||
ctx.update(planning_context_prompt_variables(planning_context))
|
||||
if s == "exercise_summary":
|
||||
return {k: ctx[k] for k in ("exercise_title", "exercise_focus_area", "exercise_goal", "exercise_execution")}
|
||||
return {
|
||||
k: ctx[k]
|
||||
for k in (
|
||||
"exercise_title",
|
||||
"exercise_focus_area",
|
||||
"exercise_goal",
|
||||
"exercise_execution",
|
||||
"planning_context_json",
|
||||
"has_planning_context",
|
||||
)
|
||||
}
|
||||
if s == "exercise_instruction_rewrite":
|
||||
return ctx
|
||||
if s == "exercise_skill_suggestions":
|
||||
@@ -893,6 +907,7 @@ def run_exercise_ai_suggestion(
|
||||
execution=execution,
|
||||
focus_area_hint=focus_area_hint,
|
||||
focus_areas_context=focus_areas_context,
|
||||
planning_context=form_ctx.planning_context,
|
||||
)
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=500, detail=str(e)) from e
|
||||
@@ -938,6 +953,7 @@ def run_exercise_ai_suggestion(
|
||||
execution=execution,
|
||||
focus_area_hint=focus_area_hint,
|
||||
focus_areas_context=focus_areas_context,
|
||||
planning_context=form_ctx.planning_context,
|
||||
)
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=500, detail=str(e)) from e
|
||||
@@ -1015,6 +1031,7 @@ def run_exercise_ai_suggestion(
|
||||
trainer_notes=trainer_notes,
|
||||
focus_area_hint=focus_area_hint,
|
||||
focus_areas_context=focus_areas_context,
|
||||
planning_context=form_ctx.planning_context,
|
||||
)
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=500, detail=str(e)) from e
|
||||
|
||||
Reference in new issue
Block a user