Keep conversational fallback on the requested meaning
CI / test (push) Successful in 1m3s
CI / test (pull_request) Successful in 1m3s

This commit is contained in:
m
2026-08-25 00:57:48 +03:00
parent ca9db836de
commit b029adfb43
4 changed files with 67 additions and 7 deletions
+4 -2
View File
@@ -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, "подробност") {