-
Notifications
You must be signed in to change notification settings - Fork 41
ConversationBase, Email Memory example updates #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
gvanrossum-ms
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not email.db. :-)
| await conversation.add_messages_with_indexing([email]) | ||
| context.log_indexed(email_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. :-(
| from .email_message import EmailMessage, EmailMessageMeta | ||
|
|
||
|
|
||
| def import_emails_from_dir( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename clean -> clear
Uh oh!
There was an error while loading. Please reload this page.