소스 검색

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

Roc 2 달 전
부모
커밋
bcb1747484
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  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,