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
@@ -49,9 +49,10 @@ class PlanningIntentContext:
|
||||
context_notes: str = ""
|
||||
topic_type: str = "general"
|
||||
technique_sibling_excludes: List[str] = field(default_factory=list)
|
||||
catalog_exercise_hints: Optional[str] = None
|
||||
|
||||
def to_api_dict(self) -> Dict[str, Any]:
|
||||
return {
|
||||
out = {
|
||||
"source_query": self.source_query,
|
||||
"primary_topic": self.primary_topic,
|
||||
"topic_type": self.topic_type,
|
||||
@@ -61,6 +62,10 @@ class PlanningIntentContext:
|
||||
"technique_sibling_excludes": self.technique_sibling_excludes[:16],
|
||||
"context_notes": self.context_notes[:1200] or None,
|
||||
}
|
||||
hints = (self.catalog_exercise_hints or "").strip()
|
||||
if hints:
|
||||
out["catalog_exercise_hints"] = hints[:2000]
|
||||
return out
|
||||
|
||||
|
||||
def build_planning_intent_context(
|
||||
@@ -70,6 +75,8 @@ def build_planning_intent_context(
|
||||
goal_analysis: Optional[Mapping[str, Any]] = None,
|
||||
extra_context: Optional[str] = None,
|
||||
primary_topic: Optional[str] = None,
|
||||
cur=None,
|
||||
catalog=None,
|
||||
) -> PlanningIntentContext:
|
||||
"""Intent aus Anfrage, Zielanalyse und optionalem Kontext — ohne Sonderregeln pro Thema."""
|
||||
ga = dict(goal_analysis or {})
|
||||
@@ -124,6 +131,12 @@ def build_planning_intent_context(
|
||||
if line not in path_success:
|
||||
path_success.insert(0, line)
|
||||
|
||||
catalog_hints = ""
|
||||
if cur is not None and catalog is not None:
|
||||
from planning_prompt_variables import catalog_exercise_hints_block
|
||||
|
||||
catalog_hints = catalog_exercise_hints_block(cur, catalog)
|
||||
|
||||
return PlanningIntentContext(
|
||||
source_query=(goal_query or "").strip(),
|
||||
primary_topic=topic,
|
||||
@@ -133,6 +146,7 @@ def build_planning_intent_context(
|
||||
explicit_exclusions=explicit,
|
||||
technique_sibling_excludes=siblings[:16],
|
||||
context_notes=combined_notes[:1200],
|
||||
catalog_exercise_hints=catalog_hints or None,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user