Enhance Planning AI Context with Catalog Exercise Hints
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Successful in 1m15s
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Successful in 1m15s
- Introduced support for catalog exercise hints in various functions, including `_build_stage_ai_context`, `try_suggest_ai_stage_step`, and `build_gap_fill_goal_text`, improving the contextual information available for AI suggestions. - Added a new function `catalog_exercise_hints_block` to consolidate hints retrieval from the catalog context. - Updated the `PlanningIntentContext` to include catalog exercise hints, ensuring they are part of the API output. - Implemented tests to verify the inclusion of catalog exercise hints in goal text generation and rematch logic. - Incremented version numbers and updated changelog to reflect these enhancements.
This commit is contained in:
1 parent
35fe31774b
commit
3181cc126d
11 files changed
+166
-14
No files matched your search
@@ -34,6 +34,27 @@ _PLANNING_PROMPT_VARIABLE_PROVIDERS: tuple[PlanningPromptVariableProvider, ...]
|
||||
)
|
||||
|
||||
|
||||
def catalog_exercise_hints_block(
|
||||
cur,
|
||||
catalog: Optional[ProgressionPlanningCatalogContext] = None,
|
||||
*,
|
||||
slug: Optional[str] = None,
|
||||
) -> str:
|
||||
"""Kombinierte hints_on_exercise aus aktivem Katalog-Kontext (Gap-Fill / Intent)."""
|
||||
if cur is None or catalog is None:
|
||||
return ""
|
||||
from catalog_prompt_slots import CATALOG_KINDS, placeholder_key
|
||||
|
||||
merged = merge_planning_prompt_variables(cur, {}, catalog=catalog, slug=slug)
|
||||
lines: list[str] = []
|
||||
for cfg in CATALOG_KINDS:
|
||||
key = placeholder_key(cfg.kind, "hints_on_exercise")
|
||||
text = (merged.get(key) or "").strip()
|
||||
if text:
|
||||
lines.append(f"{cfg.label_de}: {text}")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def merge_planning_prompt_variables(
|
||||
cur,
|
||||
base_variables: Mapping[str, str],
|
||||
@@ -113,6 +134,7 @@ def planning_prompt_placeholder_catalog() -> dict:
|
||||
|
||||
|
||||
__all__ = [
|
||||
"catalog_exercise_hints_block",
|
||||
"merge_planning_prompt_variables",
|
||||
"planning_prompt_placeholder_catalog",
|
||||
]
|
||||
Reference in new issue
Block a user