Enhance Planning Exercise Retrieval and Suggestion with Semantic Features
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 40s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m14s
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 40s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m14s
- Introduced new functions to load exercise goals and variant names in chunks, improving data retrieval efficiency. - Integrated semantic scoring into the ranking logic, allowing for more nuanced exercise suggestions based on semantic relevance. - Updated the planning exercise suggestion process to include semantic brief handling, enriching the context for exercise recommendations. - Adjusted the retrieval phase to incorporate dynamic retrieval weights based on semantic strength, enhancing the overall suggestion accuracy. - Incremented version to 0.8.186 and updated changelog to reflect these significant enhancements in planning AI functionality.
This commit is contained in:
1 parent
a19ed02300
commit
c6b8c396ad
14 files changed
+1393
-41
No files matched your search
@@ -19,6 +19,8 @@ function mapApiStepToRow(step) {
|
||||
variantId,
|
||||
variants,
|
||||
reasons: Array.isArray(step?.reasons) ? step.reasons : [],
|
||||
isBridge: Boolean(step?.is_bridge),
|
||||
semanticScore: step?.semantic_score,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +36,8 @@ export default function ExerciseProgressionPathBuilder({
|
||||
const [saving, setSaving] = useState(false)
|
||||
const [error, setError] = useState('')
|
||||
const [targetSummary, setTargetSummary] = useState(null)
|
||||
const [semanticBrief, setSemanticBrief] = useState(null)
|
||||
const [pathQa, setPathQa] = useState(null)
|
||||
const [pathSteps, setPathSteps] = useState([])
|
||||
|
||||
const patchStep = useCallback((idx, patch) => {
|
||||
@@ -73,6 +77,8 @@ export default function ExerciseProgressionPathBuilder({
|
||||
query: q,
|
||||
max_steps: Number(maxSteps),
|
||||
include_llm_intent: true,
|
||||
include_path_qa: true,
|
||||
include_llm_path_qa: true,
|
||||
progression_graph_id: Number(graphId),
|
||||
})
|
||||
const rows = (Array.isArray(res?.steps) ? res.steps : []).map(mapApiStepToRow)
|
||||
@@ -81,12 +87,16 @@ export default function ExerciseProgressionPathBuilder({
|
||||
}
|
||||
setPathSteps(rows)
|
||||
setTargetSummary(res?.target_profile_summary || null)
|
||||
setSemanticBrief(res?.semantic_brief_summary || null)
|
||||
setPathQa(res?.path_qa || null)
|
||||
if (!segmentNotes.trim() && q) setSegmentNotes(q.slice(0, 400))
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
setError(e.message || 'Pfad-Vorschlag fehlgeschlagen')
|
||||
setPathSteps([])
|
||||
setTargetSummary(null)
|
||||
setSemanticBrief(null)
|
||||
setPathQa(null)
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
@@ -122,6 +132,8 @@ export default function ExerciseProgressionPathBuilder({
|
||||
})
|
||||
setPathSteps([])
|
||||
setTargetSummary(null)
|
||||
setSemanticBrief(null)
|
||||
setPathQa(null)
|
||||
if (typeof onSaved === 'function') await onSaved()
|
||||
alert(`${n} Nachfolger-Kante(n) aus KI-Pfad gespeichert.`)
|
||||
} catch (e) {
|
||||
@@ -142,8 +154,8 @@ export default function ExerciseProgressionPathBuilder({
|
||||
>
|
||||
<h3 style={{ marginTop: 0, fontSize: '1rem' }}>KI: Pfad zum Ziel</h3>
|
||||
<p style={{ fontSize: '12px', color: 'var(--text3)', marginTop: 0, lineHeight: 1.45 }}>
|
||||
Ziel in Freitext formulieren — die Planungs-KI schlägt eine aufbauende Übungsreihe vor. Nach Review als
|
||||
Nachfolger-Ketten in den aktiven Graph speichern (über mehrere Trainingspläne hinweg nutzbar).
|
||||
Ziel in Freitext formulieren — die Planungs-KI schlägt eine semantisch passende, aufbauende Reihenfolge vor,
|
||||
prüft Lücken (ggf. Brücken-Übungen) und optional per LLM-QS. Nach Review in den Graph speichern.
|
||||
</p>
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '10px', alignItems: 'flex-end' }}>
|
||||
<div className="form-row" style={{ flex: '2 1 240px', marginBottom: 0 }}>
|
||||
@@ -184,15 +196,59 @@ export default function ExerciseProgressionPathBuilder({
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
{targetSummary && pathSteps.length > 0 ? (
|
||||
{(semanticBrief || targetSummary) && pathSteps.length > 0 ? (
|
||||
<div style={{ marginTop: '10px', display: 'flex', flexWrap: 'wrap', gap: '6px' }}>
|
||||
{Array.isArray(targetSummary.focus_areas) &&
|
||||
targetSummary.focus_areas.slice(0, 2).map((fa) => (
|
||||
{semanticBrief?.primary_topic ? (
|
||||
<span className="exercise-tag" style={{ borderColor: 'var(--accent)' }}>
|
||||
Thema: {semanticBrief.primary_topic}
|
||||
</span>
|
||||
) : null}
|
||||
{Array.isArray(semanticBrief?.development_arc) &&
|
||||
semanticBrief.development_arc.slice(0, 3).map((phase) => (
|
||||
<span key={phase} className="exercise-tag">
|
||||
{phase}
|
||||
</span>
|
||||
))}
|
||||
{Array.isArray(targetSummary?.focus_areas) &&
|
||||
targetSummary.focus_areas.slice(0, 1).map((fa) => (
|
||||
<span key={fa} className="exercise-tag">
|
||||
Fokus: {fa}
|
||||
</span>
|
||||
))}
|
||||
{Array.isArray(targetSummary.top_skills) &&
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{pathQa && pathSteps.length > 0 ? (
|
||||
<div
|
||||
style={{
|
||||
marginTop: '10px',
|
||||
padding: '10px 12px',
|
||||
borderRadius: '8px',
|
||||
background: pathQa.overall_ok ? 'color-mix(in srgb, var(--accent) 8%, var(--surface2))' : 'color-mix(in srgb, var(--danger) 8%, var(--surface2))',
|
||||
fontSize: '12px',
|
||||
lineHeight: 1.45,
|
||||
}}
|
||||
>
|
||||
<strong>
|
||||
Pfad-QS: {pathQa.overall_ok ? 'OK' : 'Hinweise'}
|
||||
{pathQa.quality_score != null ? ` (${Math.round(Number(pathQa.quality_score) * 100)} %)` : ''}
|
||||
</strong>
|
||||
{pathQa.topic_coverage ? (
|
||||
<p style={{ margin: '6px 0 0', color: 'var(--text2)' }}>{pathQa.topic_coverage}</p>
|
||||
) : null}
|
||||
{Array.isArray(pathQa.issues) && pathQa.issues.length > 0 ? (
|
||||
<ul style={{ margin: '6px 0 0', paddingLeft: '16px', color: 'var(--text2)' }}>
|
||||
{pathQa.issues.slice(0, 4).map((issue) => (
|
||||
<li key={issue}>{issue}</li>
|
||||
))}
|
||||
</ul>
|
||||
) : null}
|
||||
{Number(pathQa.bridge_insert_count) > 0 ? (
|
||||
<p style={{ margin: '6px 0 0', color: 'var(--accent-dark)' }}>
|
||||
{pathQa.bridge_insert_count} Brücken-Übung(en) eingefügt (Lückenfüller).
|
||||
</p>
|
||||
) : null}
|
||||
{Array.isArray(targetSummary?.top_skills) &&
|
||||
targetSummary.top_skills.slice(0, 2).map((sk) => (
|
||||
<span key={sk.skill_id} className="exercise-tag">
|
||||
{sk.name}
|
||||
@@ -220,6 +276,7 @@ export default function ExerciseProgressionPathBuilder({
|
||||
<div className="form-row" style={{ marginBottom: 0 }}>
|
||||
<label className="form-label">
|
||||
Schritt {idx + 1}
|
||||
{step.isBridge ? ' (Brücke)' : ''}
|
||||
{idx === 0 ? ' (Einstieg)' : idx === pathSteps.length - 1 ? ' (Zielnähe)' : ''}
|
||||
</label>
|
||||
<div style={{ fontSize: '13px' }}>
|
||||
|
||||
Reference in new issue
Block a user