Keep conversational fallback on the requested meaning
This commit is contained in:
@@ -186,7 +186,7 @@ func selectionObjectiveForMeaning(meaning cognitive.TaskMeaning, message string)
|
||||
}
|
||||
|
||||
func builtinAdvisory(request cognitive.GatewayAdvisoryRequest) cognitive.GatewayAdvisoryResponse {
|
||||
text := "Я — Домовой, ваш помощник. Помогаю разбираться в вопросах, искать информацию и выполнять задачи."
|
||||
text := "Проверю запрос доступным маршрутом и сообщу результат."
|
||||
switch request.Meaning.InformationRequestKind {
|
||||
case interaction.InformationRequestCognitiveModelInventory:
|
||||
text = "Проверю подключённые модели. Ключи и пароли не показываю."
|
||||
@@ -201,7 +201,9 @@ func builtinAdvisory(request cognitive.GatewayAdvisoryRequest) cognitive.Gateway
|
||||
case "REQUEST_TO_INVESTIGATE":
|
||||
text = "Понял задачу. Проверю доступный путь и сообщу результат."
|
||||
case "QUESTION":
|
||||
text = "Я — Домовой, ваш помощник. Помогаю разбираться в вопросах, искать информацию и выполнять задачи."
|
||||
text = "Проверю вопрос доступным источником и отвечу по существу."
|
||||
case "CONVERSATIONAL":
|
||||
text = "Я — Домовой, ваш помощник."
|
||||
}
|
||||
}
|
||||
return cognitive.GatewayAdvisoryResponse{Version: request.Version, RequestID: request.RequestID, AdvisoryText: text, FinishReason: cognitive.FinishCompleted}
|
||||
|
||||
@@ -196,7 +196,7 @@ func TestBuiltInAdvisoryIdentityIsNaturalAndDoesNotMentionResponseLength(t *test
|
||||
RequestID: "request-identity",
|
||||
Meaning: cognitive.TaskMeaning{SpeechAct: "QUESTION"},
|
||||
})
|
||||
if response.AdvisoryText != "Я — Домовой, ваш помощник. Помогаю разбираться в вопросах, искать информацию и выполнять задачи." {
|
||||
if response.AdvisoryText != "Проверю вопрос доступным источником и отвечу по существу." {
|
||||
t.Fatalf("unexpected identity response: %q", response.AdvisoryText)
|
||||
}
|
||||
if strings.Contains(response.AdvisoryText, "коротко") || strings.Contains(response.AdvisoryText, "подробност") {
|
||||
|
||||
Reference in New Issue
Block a user