|
@@ -100,18 +100,18 @@ func (q *cQuestion) DetailQuestion(ctx context.Context, qRes *QuestionReq) (repl
|
|
|
if err != nil {
|
|
|
return "", 0, err
|
|
|
}
|
|
|
- if sRes.Result.Answer != "" {
|
|
|
- return sRes.Result.Answer, Answer_ChatGPT, nil
|
|
|
+ if sRes.Result.Answer == "" {
|
|
|
+ cRes, err := ChatGpt.GPTDo(ctx, qRes)
|
|
|
+ if err != nil {
|
|
|
+ return "", 0, err
|
|
|
+ }
|
|
|
+ return fsw.Repl(cRes.Response), Answer_ChatGPT, nil
|
|
|
}
|
|
|
|
|
|
- cRes, err := ChatGpt.GPTDo(ctx, qRes)
|
|
|
- if err != nil {
|
|
|
- return "", 0, err
|
|
|
- }
|
|
|
// 校验是否有业务逻辑
|
|
|
- matchArr := regExpSmart.FindStringSubmatch(cRes.Response)
|
|
|
+ matchArr := regExpSmart.FindStringSubmatch(sRes.Result.Answer)
|
|
|
if len(matchArr) == 0 {
|
|
|
- return fsw.Repl(cRes.Response), Answer_ChatGPT, nil
|
|
|
+ return fsw.Repl(sRes.Result.Answer), Answer_UsuallyProblem, nil
|
|
|
}
|
|
|
// 查询业务逻辑
|
|
|
var bRes = &BusinessRes{}
|