@@ -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