Enhance Planning Exercise Path AI and UI Integration
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 40s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m13s
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 40s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m13s
- Updated the AI gap filling logic to include structured offers for unfilled gaps, improving the user experience in the Exercise Progression Path Builder. - Introduced new functions for detecting off-topic steps and parsing LLM-suggested exercises, enhancing the contextual relevance of exercise suggestions. - Enhanced the frontend components to support new AI proposal features, including quick creation modals for newly suggested exercises. - Incremented version to 0.8.190 and updated changelog to reflect these improvements in planning AI functionality.
This commit is contained in:
1 parent
8d1dd59c3c
commit
3450a9296a
7 files changed
+915
-88
No files matched your search
@@ -15,11 +15,13 @@ from planning_exercise_profiles import PlanningTargetProfile
|
||||
from planning_exercise_path_qa import (
|
||||
apply_llm_path_reorder,
|
||||
build_path_qa_summary,
|
||||
detect_off_topic_steps,
|
||||
detect_path_gaps,
|
||||
insert_bridge_exercises,
|
||||
parse_llm_suggested_new_exercises,
|
||||
try_llm_qa_progression_path,
|
||||
)
|
||||
from planning_exercise_path_ai_fill import insert_ai_proposals_for_gaps
|
||||
from planning_exercise_path_ai_fill import apply_gap_fill_after_qa, collect_gap_fill_specs
|
||||
from planning_exercise_retrieval import run_multistage_planning_retrieval
|
||||
from planning_exercise_semantics import (
|
||||
PlanningSemanticBrief,
|
||||
@@ -394,6 +396,8 @@ def suggest_progression_path(
|
||||
gaps: List[Dict[str, Any]] = []
|
||||
bridge_inserts: List[Dict[str, Any]] = []
|
||||
ai_proposals: List[Dict[str, Any]] = []
|
||||
gap_fill_offers: List[Dict[str, Any]] = []
|
||||
off_topic_steps: List[Dict[str, Any]] = []
|
||||
llm_qa: Optional[Dict[str, Any]] = None
|
||||
llm_qa_applied = False
|
||||
reorder_applied = False
|
||||
@@ -424,15 +428,6 @@ def suggest_progression_path(
|
||||
bridge_search_fn=bridge_fn,
|
||||
)
|
||||
|
||||
if body.include_ai_gap_fill and unfilled_gaps:
|
||||
steps, ai_proposals = insert_ai_proposals_for_gaps(
|
||||
cur,
|
||||
steps,
|
||||
unfilled_gaps,
|
||||
goal_query=goal_query,
|
||||
brief=semantic_brief,
|
||||
)
|
||||
|
||||
if body.include_llm_path_qa:
|
||||
llm_qa, llm_qa_applied = try_llm_qa_progression_path(
|
||||
cur,
|
||||
@@ -452,10 +447,39 @@ def suggest_progression_path(
|
||||
if llm_qa.get("overall_ok") or (q_val is not None and q_val >= 0.45):
|
||||
steps, reorder_applied, reorder_notes = apply_llm_path_reorder(steps, llm_qa)
|
||||
|
||||
off_topic_steps = detect_off_topic_steps(cur, steps, brief=semantic_brief)
|
||||
llm_gap_specs = parse_llm_suggested_new_exercises(
|
||||
llm_qa,
|
||||
brief=semantic_brief,
|
||||
step_count=len(steps),
|
||||
)
|
||||
|
||||
if body.include_ai_gap_fill:
|
||||
gap_specs = collect_gap_fill_specs(
|
||||
steps=steps,
|
||||
unfilled_gaps=unfilled_gaps,
|
||||
off_topic_steps=off_topic_steps,
|
||||
llm_specs=llm_gap_specs,
|
||||
brief=semantic_brief,
|
||||
goal_query=goal_query,
|
||||
)
|
||||
steps, ai_proposals, gap_fill_offers = apply_gap_fill_after_qa(
|
||||
cur,
|
||||
steps,
|
||||
gap_specs,
|
||||
goal_query=goal_query,
|
||||
brief=semantic_brief,
|
||||
include_ai_calls=True,
|
||||
max_ai_proposals=3,
|
||||
auto_insert_proposals=False,
|
||||
)
|
||||
|
||||
path_qa = build_path_qa_summary(
|
||||
gaps=gaps,
|
||||
bridge_inserts=bridge_inserts,
|
||||
ai_proposals=ai_proposals,
|
||||
gap_fill_offers=gap_fill_offers,
|
||||
off_topic_steps=off_topic_steps,
|
||||
llm_qa=llm_qa,
|
||||
llm_applied=llm_qa_applied,
|
||||
reorder_applied=reorder_applied,
|
||||
@@ -472,6 +496,8 @@ def suggest_progression_path(
|
||||
retrieval_parts.append("path_reorder")
|
||||
if ai_proposals:
|
||||
retrieval_parts.append("ai_gap_fill")
|
||||
if gap_fill_offers:
|
||||
retrieval_parts.append("gap_fill_offers")
|
||||
|
||||
return {
|
||||
"goal_query": goal_query,
|
||||
@@ -484,6 +510,7 @@ def suggest_progression_path(
|
||||
"query_intent_summary": first_intent_summary,
|
||||
"progression_graph_id": body.progression_graph_id,
|
||||
"path_qa": path_qa,
|
||||
"gap_fill_offers": gap_fill_offers,
|
||||
"retrieval_phase": "+".join(retrieval_parts),
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user