Skip to content

Commit eee15fc

Browse files
committed
Fix: InMemoryMemoryService search with non-Latin text
1 parent 8c4ff74 commit eee15fc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/google/adk/memory/in_memory_memory_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def _user_key(app_name: str, user_id: str) -> str:
3838

3939

4040
def _extract_words_lower(text: str) -> set[str]:
41-
"""Extracts words from a string and converts them to lowercase."""
42-
return set([word.lower() for word in re.findall(r'[A-Za-z]+', text)])
41+
"""Extracts words from a string and converts them to lowercase, supporting Unicode."""
42+
return set([word.lower() for word in re.findall(r'\w+', text, re.UNICODE)])
4343

4444

4545
class InMemoryMemoryService(BaseMemoryService):

0 commit comments

Comments
 (0)