Handle memory identity and travel follow-ups
This commit is contained in:
@@ -133,7 +133,7 @@ func PreferredAssistantName(message string) string {
|
||||
continue
|
||||
}
|
||||
for _, candidate := range tokens[index+1:] {
|
||||
if candidate == "тебя" || candidate == "тебе" || candidate == "себя" || candidate == "меня" {
|
||||
if candidate == "тебя" || candidate == "тебе" || candidate == "себя" || candidate == "меня" || candidate == "в" || candidate == "теперь" || candidate == "же" {
|
||||
continue
|
||||
}
|
||||
if candidate == "буду" || candidate == "будет" || candidate == "запомни" || candidate == "помни" || candidate == "ты" || candidate == "это" {
|
||||
@@ -144,12 +144,19 @@ func PreferredAssistantName(message string) string {
|
||||
}
|
||||
runes := []rune(candidate)
|
||||
runes[0] = []rune(strings.ToUpper(string(runes[0])))[0]
|
||||
return string(runes)
|
||||
return normalizeAssistantName(string(runes))
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func normalizeAssistantName(value string) string {
|
||||
if strings.HasSuffix(value, "ю") {
|
||||
return strings.TrimSuffix(value, "ю") + "я"
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
// IsIdentityInquiry identifies a request about the assistant itself by its
|
||||
// interrogative meaning. Punctuation is optional and wording may vary.
|
||||
func IsIdentityInquiry(message string) bool {
|
||||
@@ -592,6 +599,9 @@ func informationRequestKind(message string, candidate interaction.SemanticCandid
|
||||
if len(tokens) == 0 {
|
||||
return ""
|
||||
}
|
||||
if containsStemInTokens(tokens, "памят", "помнишь", "ячейк") && (containsMeaningfulInterrogative(tokens) || containsStemInTokens(tokens, "вывед", "покаж", "напиш", "сообщ")) {
|
||||
return interaction.InformationRequestMemoryInventory
|
||||
}
|
||||
inquiry := candidate.PrimarySpeechAct == interaction.SpeechActQuestion || candidate.PrimarySpeechAct == interaction.SpeechActRequestToInvestigate || candidate.SecondarySpeechAct == interaction.SpeechActQuestion || candidate.SecondarySpeechAct == interaction.SpeechActRequestToInvestigate
|
||||
cognitiveSubject := containsStemInTokens(tokens, "модел", "ии", "ai", "локальн", "когнитив", "канал")
|
||||
inventoryCue := containsStemInTokens(tokens, "список", "доступ", "подключ", "вариант") || (containsMeaningfulInterrogative(tokens) && containsStemInTokens(tokens, "настро"))
|
||||
|
||||
Reference in New Issue
Block a user