Adaptiven A1-Kurs und statistisches Aussprachetraining integrieren
Direkte DeepSeek- und Mistral-Anbindung mit versionierten Aktionsprofilen, Budgetreservierung, Tokenabrechnung und administrativen Qualitätsprüfungen ersetzen die Flowise-Abhängigkeit im regulären Betrieb. 840 geprüfte A1-Aufgaben mit geschützter Testauswertung und konkreten offenen Arbeitsaufträgen ergänzen den Kurs. Inhalts- und Sprachbewertung bleiben von Azure-Aussprachewerten getrennt; historische Aufgaben und Antworten bleiben erhalten. Echte Wort- und Phonemmessungen werden mit Herkunft, Aktualität und Nachweisdichte gebündelt. Go bestimmt Trainingsziele und Wiederholungen, das Modell formuliert dazu passende Nachsprechübungen. Profilansicht und Auswahlgründe werden angezeigt. Validierung: Go-Race-Tests mit lokaler PostgreSQL-Integration, go vet, Web-Build, Audit aller 840 Aufgaben und drei Browser-Smokes mit lokalen Modell-/Speech-Fixtures bestanden. Keine Produktionsänderungen oder Live-Aufrufe.
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"speech-learning-api/internal/domain"
|
||||
)
|
||||
|
||||
func TestMinistralOmitsUnsupportedReasoningParameter(t *testing.T) {
|
||||
for _, model := range []string{"ministral-14b-2512", "ministral-8b-latest", "ministral-3b-2512"} {
|
||||
for _, effort := range []string{"", "none"} {
|
||||
p := aiTestProfile("next_exercise")
|
||||
p.Model, p.ReasoningEffort = model, effort
|
||||
if err := ValidAIProfile(p); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
body := map[string]any{}
|
||||
applyAIReasoning(body, p)
|
||||
if len(body) != 0 {
|
||||
t.Fatalf("unsupported parameters: %v", body)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Real reasoning settings remain intact for models that support them.
|
||||
body := map[string]any{}
|
||||
applyAIReasoning(body, domain.AIProfile{Provider: "mistral", Model: "mistral-small-2603", ReasoningEffort: "none"})
|
||||
if body["reasoning_effort"] != "none" {
|
||||
t.Fatal("Small thinking control lost")
|
||||
}
|
||||
body = map[string]any{}
|
||||
applyAIReasoning(body, domain.AIProfile{Provider: "deepseek", ReasoningEffort: "none"})
|
||||
if _, ok := body["reasoning_effort"]; ok || body["thinking"].(map[string]string)["type"] != "disabled" {
|
||||
t.Fatal("DeepSeek control changed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAIProfileSaveExplainsMissingFields(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
change func(*domain.AIProfile)
|
||||
want string
|
||||
}{
|
||||
{func(p *domain.AIProfile) { p.Model = "" }, "Modell-ID fehlt"},
|
||||
{func(p *domain.AIProfile) { p.PricingSet = false }, "Preise nicht bestätigt"},
|
||||
{func(p *domain.AIProfile) { p.Model = "ministral-14b-2512"; p.ReasoningEffort = "low" }, "Nicht senden"},
|
||||
} {
|
||||
p := aiTestProfile("next_exercise")
|
||||
tc.change(&p)
|
||||
if err := ValidAIProfile(p); err == nil || !strings.Contains(err.Error(), tc.want) {
|
||||
t.Fatalf("missing actionable error: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user