This commit is contained in:
@@ -362,6 +362,9 @@ func needsCognitionForCandidate(primary, secondary interaction.SpeechAct, tokens
|
||||
if secondary == interaction.SpeechActQuestion || secondary == interaction.SpeechActRequestToInvestigate {
|
||||
return true
|
||||
}
|
||||
if isAssistantStatusProbe(primary, secondary, tokens) {
|
||||
return true
|
||||
}
|
||||
if primary == interaction.SpeechActDirective && (containsInterrogative(tokens) || containsModelReference(tokens) || containsStemInTokens(tokens, "обрати", "посмотри", "разбер", "исправ", "обнов", "добав")) {
|
||||
return true
|
||||
}
|
||||
@@ -392,6 +395,9 @@ func capabilityHintsFor(primary, secondary interaction.SpeechAct, tokens []strin
|
||||
if primary == interaction.SpeechActQuestion || primary == interaction.SpeechActRequestToInvestigate || secondary == interaction.SpeechActQuestion || secondary == interaction.SpeechActRequestToInvestigate {
|
||||
add("COGNITIVE_REASONING")
|
||||
}
|
||||
if isAssistantStatusProbe(primary, secondary, tokens) {
|
||||
add("COGNITIVE_REASONING")
|
||||
}
|
||||
if isExplicitReminder(tokens) {
|
||||
add("SCHEDULE_REMINDER")
|
||||
}
|
||||
@@ -553,6 +559,21 @@ func containsModelReference(tokens []string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func isAssistantStatusProbe(primary, secondary interaction.SpeechAct, tokens []string) bool {
|
||||
if primary != interaction.SpeechActAssertion && primary != interaction.SpeechActCorrection && primary != interaction.SpeechActQuestion && primary != interaction.SpeechActRequestToInvestigate {
|
||||
return false
|
||||
}
|
||||
if !(containsToken(tokens, "домовой") || containsToken(tokens, "ассистент") || containsToken(tokens, "бот") || containsToken(tokens, "ты") || containsToken(tokens, "ии") || containsToken(tokens, "ai") || containsToken(tokens, "gpt")) {
|
||||
return false
|
||||
}
|
||||
for index := 0; index < len(tokens)-1; index++ {
|
||||
if tokens[index] == "не" && (containsStem(tokens[index+1], "вид", "понима", "ответ", "работа", "реагир", "слыш", "ищ", "уведом", "чувств")) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func isExplicitEmailAction(tokens []string) bool {
|
||||
hasMailObject := containsToken(tokens, "письмо") || containsToken(tokens, "письма") || containsToken(tokens, "почту") || containsToken(tokens, "почта")
|
||||
hasMailVerb := containsStemInTokens(tokens, "отправ", "ответ", "напиш", "пиши", "напишите")
|
||||
@@ -565,4 +586,4 @@ func isExplicitReminder(tokens []string) bool {
|
||||
return true
|
||||
}
|
||||
return containsStemInTokens(tokens, "напомин", "напомни")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +135,7 @@ func TestInterpretUtteranceNaturalRussianHelpflowUsesContextAwareCognitionInput(
|
||||
{message: "нет не UPO а UPO2", wantSpeech: interaction.SpeechActCorrection, wantCognition: false},
|
||||
{message: "нет не UPO а UPO2 и обнови конфиг", wantSpeech: "", wantCognition: true, allowNoMatch: true},
|
||||
{message: "postgres сейчас работает", wantSpeech: "", wantCognition: true, allowNoMatch: true},
|
||||
{message: "сейчас домовой не видит ии", wantSpeech: "", wantCognition: true, allowNoMatch: true},
|
||||
{message: "основная база называется UPO", wantSpeech: interaction.SpeechActAssertion, wantCognition: false},
|
||||
{message: "привет", wantSpeech: interaction.SpeechActConversational, wantCognition: false},
|
||||
{message: "спасибо", wantSpeech: interaction.SpeechActConversational, wantCognition: false},
|
||||
@@ -206,4 +207,4 @@ func activeFocus(projectID situation.ProjectID, displayName string) *situation.A
|
||||
SourceUtteranceID: "utterance-focus",
|
||||
UpdatedAtUnixMillis: time.Unix(90, 0).UnixMilli(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user