Allow no knowledge
This commit is contained in:
parent
f0fa71f141
commit
c65baeba0b
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue