ConversationBase, Email Memory example updates - #19
Conversation
gvanrossum-ms
left a comment
There was a problem hiding this comment.
Some things left for next time. Merging now because I want it.
| self.conversation = await load_or_create_email_index( | ||
| str(self.db_path), create_new | ||
| ) | ||
| self.index_log = load_index_log(str(self.db_path), create_new) |
There was a problem hiding this comment.
I take it this holds a persistent, mutable mapping of email IDs to booleans? (Or rather a set of email IDs that have been indexed.)
| self.conversation = await load_or_create_email_index( | ||
| str(self.db_path), create_new=True | ||
| ) | ||
| await self.load_conversation(self.db_name, create_new=True) |
There was a problem hiding this comment.
So restart is now a synonym for load?
| print("Type @help for a list of commands") | ||
|
|
||
| db_path = str(base_path.joinpath("pyEmails.db")) | ||
| default_db = "gmail.db" # "pyEmails.db" |
There was a problem hiding this comment.
Why not email.db. :-)
| await conversation.add_messages_with_indexing([email]) | ||
| context.log_indexed(email_id) |
There was a problem hiding this comment.
Yeah, so these two aren't transactional (because the second doesn't use SQLite3) and in theory the first could succeed and the second could fail. Not sure what to do about it other than adding an extra column to the messages table for the email_ID. :-(
| @@ -14,14 +14,10 @@ | |||
|
|
|||
| def import_emails_from_dir( | |||
There was a problem hiding this comment.
Eventually this file and these functions need to switch to 'ingest'
| # Load synonyms from a file and add them as aliases | ||
| async def _add_synonyms_file_as_aliases( | ||
| conversation: IConversation, file_name: str | ||
| conversation: ConversationBase, file_name: str, clean: bool |
There was a problem hiding this comment.
Rename clean -> clear
Uh oh!
There was an error while loading. Please reload this page.