Browse Source

Merge branch 'feature/deepseek_rag_2.0' of http://8.136.199.33:3000/eta_server/eta_api into feature/deepseek_rag_2.0

kobe6258 1 week ago
parent
commit
a87e27cf55
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,