Update Klassifizierung - Teil 2

This commit is contained in:
2026-08-01 22:28:23 +02:00
parent a5cc4f881c
commit ccdc6e9d99
10 changed files with 594 additions and 144 deletions
+10 -2
View File
@@ -52,7 +52,7 @@ type FeedbackManager interface {
type DiagnosticsManager interface {
DiagnoseRun(context.Context, string) (model.RunRecord, error)
DiagnoseKnowledge(context.Context, string, string) (model.KnowledgeDiagnostic, error)
DiagnoseKnowledge(context.Context, string, string, string) (model.KnowledgeDiagnostic, error)
}
type Server struct {
@@ -270,7 +270,15 @@ func (s *Server) diagnosticKnowledge(w http.ResponseWriter, r *http.Request) {
http.Error(w, "knowledge_id required", http.StatusBadRequest)
return
}
d, err := s.diagnostics.DiagnoseKnowledge(r.Context(), strings.TrimSpace(r.PathValue("id")), kbID)
purpose := strings.ToLower(strings.TrimSpace(r.URL.Query().Get("purpose")))
if purpose == "" {
purpose = "reply"
}
if purpose != "reply" && purpose != "category" {
http.Error(w, "purpose must be category or reply", http.StatusBadRequest)
return
}
d, err := s.diagnostics.DiagnoseKnowledge(r.Context(), strings.TrimSpace(r.PathValue("id")), kbID, purpose)
if err != nil {
http.Error(w, err.Error(), http.StatusUnprocessableEntity)
return
File diff suppressed because one or more lines are too long