-
Notifications
You must be signed in to change notification settings - Fork 20
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
Switch loaded model upon chat change #134
Conversation
1d821a8
to
03e71e6
Compare
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.
lgtm
left two small unimportant comments
} | ||
} | ||
} | ||
|
||
pub fn select_chat(&mut self, chat_id: ChatID) { | ||
self.chats.set_current_chat(chat_id); | ||
|
||
if let Some(file_id) = self.get_last_used_file_id_in_current_chat() { |
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.
nitpick: maybe we can extract this chunk of added code to a function called self.load_last_model_for_current_chat()
and call it here. Just for the sake of having smaller and self documented functions.
Co-authored-by: Franco Profeti <7684329+noxware@users.noreply.github.com>
When the user switches to another chat conversation, the last used model is automatically loaded.
In addition, there are two bug fixes:
Note about existing users: Chat conversations persisted with earlier versions of the app won't auto-select the last used model because this piece of data was never stored. We could use the model used in the first interaction but it doesn't seem to worth adding more code to cover such case. As far the conversation are updated, they will be persisted in our new format and the app will behave in the new way.