fuwencai hai 1 ano
pai
achega
e906484260
Modificáronse 1 ficheiros con 13 adicións e 12 borrados
  1. 13 12
      internal/model/question.go

+ 13 - 12
internal/model/question.go

@@ -156,18 +156,19 @@ func (q *cQuestion) DetailQuestion(ctx context.Context, qRes *QuestionReq) (repl
 	if err != nil {
 		return "", nil, 0, err
 	}
-	if sRes.Result.Answer == "" {
-		poolErr := ChatGptPool.Get()
-		if poolErr != nil {
-			return "", nil, 0, poolErr
-		}
-		cRes, err := ChatGpt.GPTDo(ctx, qRes)
-		if err != nil {
-			ChatGptPool.Add()
-			return "", nil, 0, err
-		}
-		return "", cRes, Answer_ChatGPT, nil
-	}
+	//P393 stream接口不再使用
+	//if sRes.Result.Answer == "" {
+	//	poolErr := ChatGptPool.Get()
+	//	if poolErr != nil {
+	//		return "", nil, 0, poolErr
+	//	}
+	//	cRes, err := ChatGpt.GPTDo(ctx, qRes)
+	//	if err != nil {
+	//		ChatGptPool.Add()
+	//		return "", nil, 0, err
+	//	}
+	//	return "", cRes, Answer_ChatGPT, nil
+	//}
 	// 校验是否有业务逻辑
 	matchArr := regExpSmart.FindStringSubmatch(sRes.Result.Answer)
 	if len(matchArr) == 0 {