Skip to content

Commit 8a6a0c4

Browse files
committed
Test updates
1 parent d35ada3 commit 8a6a0c4

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

tools/test_email.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,7 @@ async def load_or_create_email_index(db_path: str, create_new: bool) -> EmailMem
347347
db_path,
348348
EmailMessage,
349349
)
350-
# return await EmailMemory.create(settings)
351350
email_memory = await EmailMemory.create(settings)
352-
# await email_memory.configure_memory()
353351
return email_memory
354352

355353

typeagent/emails/email_memory.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ def __init__(self, settings, name, tags):
5454
super().__init__(settings, name, tags)
5555
self.noise_terms: set[str] = set()
5656

57-
async def configure_memory(self):
58-
# Adjust settings to support knowledge extraction from message ext
59-
self.settings.semantic_ref_index_settings.auto_extract_knowledge = True
60-
# Add aliases for all the ways in which people can say 'send' and 'received'
61-
await _add_synonyms_file_as_aliases(self, "emailVerbs.json", clean=True)
62-
# Remove common terms used in email search that can make retrieval noisy
63-
_add_noise_words_from_file(self.noise_terms, "noiseTerms.txt")
64-
6557
@staticmethod
6658
def create_lang_search_options() -> searchlang.LanguageSearchOptions:
6759
return searchlang.LanguageSearchOptions(
@@ -91,9 +83,7 @@ async def create(
9183
tags: list[str] | None = None,
9284
) -> "EmailMemory":
9385
instance = await super().create(settings, name, tags)
94-
await instance.configure_memory()
95-
# Post-processing: customize instance as needed
96-
# await instance.configure_memory() # Uncomment if needed
86+
await instance._configure_memory()
9787
return instance
9888

9989
async def query(
@@ -128,6 +118,14 @@ async def query_debug(
128118
debug_context,
129119
)
130120

121+
async def _configure_memory(self):
122+
# Adjust settings to support knowledge extraction from message ext
123+
self.settings.semantic_ref_index_settings.auto_extract_knowledge = True
124+
# Add aliases for all the ways in which people can say 'send' and 'received'
125+
await _add_synonyms_file_as_aliases(self, "emailVerbs.json", clean=True)
126+
# Remove common terms used in email search that can make retrieval noisy
127+
_add_noise_words_from_file(self.noise_terms, "noiseTerms.txt")
128+
131129
def _adjust_search_options(
132130
self, options: searchlang.LanguageSearchOptions | None
133131
) -> searchlang.LanguageSearchOptions:

0 commit comments

Comments
 (0)