Update Klassifizierung - Teil 2
This commit is contained in:
+10
-2
@@ -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
Reference in New Issue
Block a user