75 lines
3.0 KiB
MySQL
75 lines
3.0 KiB
MySQL
|
|
-- Migration 073: KI-Prompt Planungs-Übungssuche — Intent/Query-Overlay (P1)
|
||
|
|
-- Spec: .claude/docs/working/PLANNING_EXERCISE_SUGGEST_CONTEXT.md §16
|
||
|
|
|
||
|
|
INSERT INTO ai_prompts (
|
||
|
|
slug, display_name, description, template,
|
||
|
|
category, output_format, output_schema, is_system_default, default_template, active, sort_order
|
||
|
|
)
|
||
|
|
SELECT
|
||
|
|
'planning_exercise_search_intent',
|
||
|
|
'Planungs-Übungssuche Intent',
|
||
|
|
'Strukturiert Freitext-Anfrage in Intent, Szenario und Katalog-Hints für Erwartungsprofil-Overlay.',
|
||
|
|
$t$Du bist Assistent für Kampfsport-Trainer in der Trainingsplanung.
|
||
|
|
Analysiere die Suchanfrage im Kontext der Einheit und des bisherigen Plans.
|
||
|
|
|
||
|
|
Ziel: JSON für ein Erwartungsprofil-Overlay (Fähigkeiten, Fokus, Stil …) — NICHT Übungs-IDs erfinden.
|
||
|
|
|
||
|
|
Szenario-Klassen (scenario):
|
||
|
|
- preset_next: nur „nächste Übung“ ohne Zusatz — selten bei Freitext
|
||
|
|
- progression: Progressionsgraph / Pfad / Folgeübung im Graph
|
||
|
|
- deepen: Vertiefung zur Anker-Übung
|
||
|
|
- continue_plan: baut auf bisherigem Plan der Einheit auf
|
||
|
|
- additive_constraint: Plan beibehalten UND zusätzliche Anforderung (z. B. „außerdem Schnellkraft“)
|
||
|
|
- free_search: offene Stichwortsuche / neues Thema
|
||
|
|
|
||
|
|
Intent (intent): suggest_next | progression_next | deepen_exercise | continue_plan_goal | free_search
|
||
|
|
|
||
|
|
emphasis:
|
||
|
|
- additive: Zusatz zur bestehenden Planung (Default bei „zusätzlich/auch/dazu“)
|
||
|
|
- replace: Suchanfrage soll Schwerpunkt eher ersetzen
|
||
|
|
- neutral: nur leichte Gewichtung
|
||
|
|
|
||
|
|
Nutze skill_hints/focus_hints etc. mit Namen aus den Katalog-JSONs (beste Übereinstimmung).
|
||
|
|
Bei requires_partner: true/false/null wenn Partnerbezug erkennbar.
|
||
|
|
|
||
|
|
Eingabe:
|
||
|
|
Suchanfrage: {{search_query}}
|
||
|
|
Heuristik-Intent: {{heuristic_intent}}
|
||
|
|
Szenario-Hinweis (Server): {{scenario_hint}}
|
||
|
|
Planungskontext: {{planning_context_json}}
|
||
|
|
Basis-Zielprofil (deterministisch): {{target_profile_json}}
|
||
|
|
|
||
|
|
Kataloge (Auszug — nur diese Namen/IDs verwenden):
|
||
|
|
Skills: {{skills_catalog_json}}
|
||
|
|
Fokus: {{focus_areas_catalog_json}}
|
||
|
|
Trainingsstil: {{training_types_catalog_json}}
|
||
|
|
Stilrichtung: {{style_directions_catalog_json}}
|
||
|
|
Zielgruppe: {{target_groups_catalog_json}}
|
||
|
|
|
||
|
|
Antworte NUR mit JSON:
|
||
|
|
{
|
||
|
|
"intent": "continue_plan_goal",
|
||
|
|
"scenario": "additive_constraint",
|
||
|
|
"skill_hints": [{"name": "Schnellkraft", "weight": 1.0}],
|
||
|
|
"focus_hints": [],
|
||
|
|
"style_hints": [],
|
||
|
|
"training_type_hints": [],
|
||
|
|
"target_group_hints": [],
|
||
|
|
"requires_partner": null,
|
||
|
|
"emphasis": "additive",
|
||
|
|
"rationale": "Kurz auf Deutsch, 1 Satz"
|
||
|
|
}$t$,
|
||
|
|
'training',
|
||
|
|
'json',
|
||
|
|
'{"type":"object","required":["intent","scenario"],"properties":{"intent":{"type":"string"},"scenario":{"type":"string"},"skill_hints":{"type":"array"},"emphasis":{"type":"string"},"rationale":{"type":"string"}}}'::jsonb,
|
||
|
|
true,
|
||
|
|
NULL,
|
||
|
|
true,
|
||
|
|
11
|
||
|
|
WHERE NOT EXISTS (SELECT 1 FROM ai_prompts WHERE slug = 'planning_exercise_search_intent');
|
||
|
|
|
||
|
|
UPDATE ai_prompts
|
||
|
|
SET default_template = template
|
||
|
|
WHERE slug = 'planning_exercise_search_intent'
|
||
|
|
AND (default_template IS NULL OR TRIM(default_template) = '');
|