Files
Speech/apps/api/internal/httpapi/pronunciation.go
T
Eugenius Naumenko e274eaab2b 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.
2026-11-01 23:23:20 +00:00

36 lines
954 B
Go

package httpapi
import (
"context"
"errors"
"net/http"
"speech-learning-api/internal/domain"
"time"
)
type pronunciationStore interface {
PronunciationProfile(context.Context, string, string, time.Time) (domain.PronunciationProfile, error)
PlanPronunciation(context.Context, string, string, time.Time) (domain.PronunciationPlan, error)
FailPronunciationPlan(context.Context, string, string) error
}
func (s *Server) pronunciationProfile(w http.ResponseWriter, r *http.Request) {
repo, ok := s.store.(pronunciationStore)
if !ok {
writeError(w, 503, errors.New("Ausspracheprofil nicht verfügbar"))
return
}
user := currentUserID(r)
profile, err := s.store.GetPrimaryProfile(r.Context(), user)
if err != nil {
writeError(w, 404, err)
return
}
result, err := repo.PronunciationProfile(r.Context(), user, profile.TargetLanguage, time.Now().UTC())
if err != nil {
writeError(w, 500, err)
return
}
writeJSON(w, 200, result)
}