-
Notifications
You must be signed in to change notification settings - Fork 168
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
Mito AI: Restore chat on refresh #1488
base: dev
Are you sure you want to change the base?
Conversation
Rename full_message_history to llm_message_history for clarity
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
clear file when clearing history
data = { | ||
"llm_history": self._llm_history, | ||
"display_history": self._display_history, | ||
} |
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.
Another option here is to just store the metadata that we send from the frontend to the backend in order to create the prompt in the .json file. Then, we can easily recreate both the llm_history
and the display_history
from them. There's no reason for the backend to care about the display_messages
for example.
What do you think about refactoring this? Is there an advantage to storing everything in the .json file itself?
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.
The reason for the backend to care about display_messages
is to be able to restore them in the frontend when the extension loads.
I chose the format of what is stored in JSON to match what is stored in the memory, so it is easy to serialize/deserialize. That being said, we don't have to strore full text representations of either and can recalculate on the fly from context objects.
As I see it, there is no compeling reason to store that metadata, becuase the only thing we do with it is to calculate LLM prompts and display messages.
${input}`}; | ||
} | ||
|
||
const removeInnerThoughtsFromMessage = (messageContent: string) => { |
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 think we're going to need this sort of post-processing code in the frontend for when we stream responses to the frontend.
Description
Testing
Documentation
N/A