Remove response length meta-text from Domovoy replies #283
@@ -186,22 +186,22 @@ func selectionObjectiveForMeaning(meaning cognitive.TaskMeaning, message string)
|
||||
}
|
||||
|
||||
func builtinAdvisory(request cognitive.GatewayAdvisoryRequest) cognitive.GatewayAdvisoryResponse {
|
||||
text := "Я — Домовой. Сейчас могу ответить коротко; если нужен подробный разбор, попросите его отдельно."
|
||||
text := "Я — Домовой, ваш помощник. Помогаю разбираться в вопросах, искать информацию и выполнять задачи."
|
||||
switch request.Meaning.InformationRequestKind {
|
||||
case interaction.InformationRequestCognitiveModelInventory:
|
||||
text = "Понял: проверю подключённые модели и коротко сообщу результат. Ключи и пароли не показываю."
|
||||
text = "Проверю подключённые модели. Ключи и пароли не показываю."
|
||||
case interaction.InformationRequestCapabilityInventory:
|
||||
text = "Понял: коротко перечислю доступные возможности и отдельно отмечу недоступные."
|
||||
text = "Проверю доступные возможности и отдельно отмечу недоступные."
|
||||
case interaction.InformationRequestCognitiveChannelStatus:
|
||||
text = "Локальный канал Домового доступен; подробности состояния дам по запросу."
|
||||
case interaction.InformationRequestCognitiveRecovery:
|
||||
text = "Понял: проверю встроенный маршрут и предложу следующий рабочий шаг."
|
||||
text = "Проверю встроенный маршрут и предложу рабочий шаг."
|
||||
default:
|
||||
switch request.Meaning.SpeechAct {
|
||||
case "REQUEST_TO_INVESTIGATE":
|
||||
text = "Понял задачу. Проверю доступный путь и коротко сообщу, что удалось установить."
|
||||
text = "Понял задачу. Проверю доступный путь и сообщу результат."
|
||||
case "QUESTION":
|
||||
text = "Я — Домовой. Отвечу коротко, а подробности добавлю, если попросите."
|
||||
text = "Я — Домовой, ваш помощник. Помогаю разбираться в вопросах, искать информацию и выполнять задачи."
|
||||
}
|
||||
}
|
||||
return cognitive.GatewayAdvisoryResponse{Version: request.Version, RequestID: request.RequestID, AdvisoryText: text, FinishReason: cognitive.FinishCompleted}
|
||||
|
||||
@@ -190,6 +190,20 @@ func TestBuiltInAdvisoryUsesTrustedInformationIntentInsteadOfMessageKeywords(t *
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuiltInAdvisoryIdentityIsNaturalAndDoesNotMentionResponseLength(t *testing.T) {
|
||||
response := builtinAdvisory(cognitive.GatewayAdvisoryRequest{
|
||||
Version: cognitive.CreatorAdvisoryV1,
|
||||
RequestID: "request-identity",
|
||||
Meaning: cognitive.TaskMeaning{SpeechAct: "QUESTION"},
|
||||
})
|
||||
if response.AdvisoryText != "Я — Домовой, ваш помощник. Помогаю разбираться в вопросах, искать информацию и выполнять задачи." {
|
||||
t.Fatalf("unexpected identity response: %q", response.AdvisoryText)
|
||||
}
|
||||
if strings.Contains(response.AdvisoryText, "коротко") || strings.Contains(response.AdvisoryText, "подробност") {
|
||||
t.Fatalf("identity response contains style meta-text: %q", response.AdvisoryText)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNoActiveBindingInvokesBuiltInLocalProvider(t *testing.T) {
|
||||
registry := ®istryStub{err: errors.New("no active binding")}
|
||||
provider := &stubAdvisoryProvider{response: cognitive.AdvisoryResponse{Version: cognitive.CreatorAdvisoryV1, RequestID: "request-1", AdvisoryText: "локальный ответ", FinishReason: cognitive.FinishCompleted}}
|
||||
|
||||
Reference in New Issue
Block a user