-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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: add knowledge tab on brains settings page #1163
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Risk Level 2 - /home/runner/work/quivr/quivr/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/BrainManagementTabs.tsx The code seems to be well written and follows good practices. However, there is a potential issue with the if (brainId === undefined) {
return <div />;
} Replace with: if (brainId === undefined) {
return <Loading />;
} Where Risk Level 3 - /home/runner/work/quivr/quivr/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeTab/DocumentItem/index.tsx The const deleteDocument = async (name: string) => {
...
setDocuments((docs) => docs.filter((doc) => doc.name !== name)); // Optimistic update
...
}; Replace with: // In a higher level component or context
const deleteDocument = async (name: string) => {
...
setDocuments((docs) => docs.filter((doc) => doc.name !== name)); // Optimistic update
...
};
// In the DocumentItem component
const deleteDocument = useContext(DeleteDocumentContext); Risk Level 4 - /home/runner/work/quivr/quivr/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeTab/DocumentItem/DocumentData.tsx
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type DocumentDetails = any; Replace with: interface DocumentDetails {
// Define the properties here
}
try {
const res = await axiosInstance.get<{ documents: DocumentDetails[] }>(
`/explore/${documentName}/`
);
setDocuments(res.data.documents);
} catch (error) {
setDocuments([]);
console.error(error);
} Replace with: try {
const res = await axiosInstance.get<{ documents: DocumentDetails[] }>(
`/explore/${documentName}/`
);
setDocuments(res.data.documents);
} catch (error) {
setError(error);
console.error(error);
} Where 🔍🔄🚀 Powered by Code Review GPT |
Screen.Recording.2023-09-13.at.15.52.34.mov
#1128