-
Notifications
You must be signed in to change notification settings - Fork 58
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
feat(chat): automatically pick the collection if there exists only one in the database VSCODE-610 #863
base: main
Are you sure you want to change the base?
Conversation
log.error('Unable to fetch collections:', error); | ||
|
||
// Users can always do this manually when asked to provide a collection name. | ||
return; |
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 am not sure what "this" is referring to here so I am not sure if there's something more to this but the behavior should be largely same with _getCollections
, I just didn't transfer the comment over as I didn't understand it.
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 comment here was alluding to if we can't fetch the collection names then a user can still input it by typing. It could definitely have been a bit more descriptive. I think that's why we're silently returning here instead of throwing an error.
const chatId = ChatMetadataStore.getChatIdFromHistoryOrNewChatId( | ||
context.history | ||
); | ||
this._chatMetadataStore.setChatMetadata(chatId, { |
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.
Does this make sense to do? If I understand right this means this will effectively cache it but I haven't tested it yet, will soon.
In interest of keeping PRs for VSCODE-610 easier to review since it mentions 3-4 new behaviors, I am splitting them into different parts. This handles the case where there is only 1 collection in the database, so we'd want to pick that instead of prompting the user.
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes