Enhance Planning Exercise Functionality and LLM Integration
Deploy Development / deploy (push) Successful in 41s
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 34s
Test Suite / playwright-tests (push) Successful in 1m15s
Deploy Development / deploy (push) Successful in 41s
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 34s
Test Suite / playwright-tests (push) Successful in 1m15s
- Added support for the new planning exercise expectation profile slug in the AI prompt runtime. - Refactored SQL parameter handling in the planning exercise retrieval process to ensure correct binding for full-text search. - Updated the planning exercise suggestion logic to incorporate LLM expectation handling, improving the accuracy of exercise recommendations. - Introduced new functions to determine when to run the LLM expectation pipeline, enhancing the decision-making process for exercise suggestions. - Incremented version to 0.8.176 and updated changelog to reflect these enhancements in planning AI capabilities.
This commit is contained in:
1 parent
04cc77d501
commit
5c882985e0
10 files changed
+332
-15
No files matched your search
@@ -25,8 +25,10 @@ def test_resolve_planning_exercise_intent_keywords():
|
||||
|
||||
def test_classify_planning_scenario_preset():
|
||||
assert is_simple_preset_query("Schlage mir die nächste Übung vor")
|
||||
assert is_simple_preset_query("nächste Übung planen")
|
||||
assert classify_planning_scenario("", "suggest_next") == SCENARIO_PRESET_NEXT
|
||||
assert classify_planning_scenario("nächste übung", "suggest_next") == SCENARIO_PRESET_NEXT
|
||||
assert classify_planning_scenario("nächste Übung planen", "suggest_next") == SCENARIO_PRESET_NEXT
|
||||
|
||||
|
||||
def test_classify_planning_scenario_additive():
|
||||
@@ -78,6 +80,47 @@ def test_compose_retrieval_phase():
|
||||
)
|
||||
|
||||
|
||||
def test_should_run_llm_expectation_for_preset_with_planning_ref():
|
||||
from planning_exercise_target_pipeline import should_run_llm_expectation_pipeline
|
||||
|
||||
assert should_run_llm_expectation_pipeline(
|
||||
SCENARIO_PRESET_NEXT,
|
||||
include_llm_intent=True,
|
||||
has_planning_reference=True,
|
||||
)
|
||||
assert not should_run_llm_expectation_pipeline(
|
||||
SCENARIO_PRESET_NEXT,
|
||||
include_llm_intent=False,
|
||||
has_planning_reference=True,
|
||||
)
|
||||
assert not should_run_llm_expectation_pipeline(
|
||||
SCENARIO_ADDITIVE,
|
||||
include_llm_intent=True,
|
||||
has_planning_reference=True,
|
||||
)
|
||||
|
||||
|
||||
def test_should_skip_llm_rank_when_expectation_applied():
|
||||
from planning_exercise_target_pipeline import SCENARIO_PRESET_NEXT, should_run_llm_rank_pipeline
|
||||
|
||||
hits = [{"score": 0.5}, {"score": 0.48}, {"score": 0.47}, {"score": 0.46}]
|
||||
assert not should_run_llm_rank_pipeline(
|
||||
"",
|
||||
SCENARIO_PRESET_NEXT,
|
||||
include_llm_rank=True,
|
||||
query_intent_applied=False,
|
||||
llm_expectation_applied=True,
|
||||
hits=hits,
|
||||
)
|
||||
|
||||
|
||||
def test_compose_retrieval_phase_llm_expectation():
|
||||
assert (
|
||||
compose_retrieval_phase(llm_expectation=True)
|
||||
== "profile_v1+llm_expectation"
|
||||
)
|
||||
|
||||
|
||||
def test_query_only_expectation_without_planning_reference():
|
||||
from planning_exercise_profiles import PlanningTargetProfile
|
||||
from planning_exercise_target_pipeline import build_planning_target_with_query_pipeline
|
||||
|
||||
Reference in new issue
Block a user