diff --git a/controllers/message.go b/controllers/message.go index 574f7e3..58f6cbd 100644 --- a/controllers/message.go +++ b/controllers/message.go @@ -173,7 +173,7 @@ func (c *ApiController) GetMessageAnswer() { var stringBuilder strings.Builder nearestText, err := object.GetNearestVectorText(authToken, chat.Owner, question) - if err != nil { + if err != nil && err.Error() != "no knowledge vectors found" { c.ResponseErrorStream(err.Error()) return } diff --git a/object/message_ai.go b/object/message_ai.go index 76588dc..c06ff7b 100644 --- a/object/message_ai.go +++ b/object/message_ai.go @@ -17,6 +17,10 @@ package object import "fmt" func GetRefinedQuestion(knowledge string, question string) string { + if knowledge == "" { + return question + } + return fmt.Sprintf(`paragraph: %s You are a reading comprehension expert. Please answer the following questions based on the provided content. The content may be in a different language from the questions, so you need to understand the content according to the language of the questions and ensure that your answers are translated into the same language as the questions: