feat: case insensitive keywords

This commit is contained in:
2026-02-02 12:35:13 +01:00
parent 2e717ec277
commit b3caff0f90
2 changed files with 24 additions and 3 deletions

View File

@@ -107,7 +107,7 @@ class AgentSpeakGenerator:
check if a keyword is a substring of the user's message.
The generated rule has the form:
keyword_said(Keyword) :- user_said(Message) & .substring(Keyword, Message, Pos) & Pos >= 0
keyword_said(Keyword) :- user_said(Message) & .substring_case_insensitive(Keyword, Message, Pos) & Pos >= 0
This enables the system to trigger behaviors based on keyword detection.
"""
@@ -119,7 +119,7 @@ class AgentSpeakGenerator:
AstRule(
AstLiteral("keyword_said", [keyword]),
AstLiteral("user_said", [message])
& AstLiteral(".substring", [keyword, message, position])
& AstLiteral(".substring_case_insensitive", [keyword, message, position])
& (position >= 0),
)
)