Browse Source

Merge remote-tracking branch 'origin/feature/deepseek_rag_2.0' into debug

Roc 1 week ago
parent
commit
bcb1747484
1 changed files with 8 additions and 0 deletions
  1. 8 0
      controllers/llm/question.go

+ 8 - 0
controllers/llm/question.go

@@ -109,6 +109,14 @@ func (c *QuestionController) Add() {
 		br.IsSendEmail = false
 		return
 	}
+	obj := rag.Question{}
+	_, err = obj.GetByCondition(` AND question_content = ? `, []interface{}{req.Content})
+	if err == nil {
+		br.Msg = "问题已入库,请不要重复添加"
+		br.IsSendEmail = false
+		return
+	}
+
 	item := &rag.Question{
 		QuestionId:      0,
 		QuestionContent: req.Content,