-
-
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: knowledge tab list #1222
feat: knowledge tab list #1222
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
379275e
to
4d12e2e
Compare
Risk Level 2 - /home/runner/work/quivr/quivr/backend/routes/knowledge_routes.py
Example: if not (knowledge.file_name or knowledge.url):
raise Exception(\"Knowledge item has no associated file or URL\") Risk Level 2 - /home/runner/work/quivr/quivr/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeTab/KnowledgeItem/useKnowledgeItem.ts
Example: if (currentBrain?.id === undefined) {
console.error(\"Current brain ID is undefined\");
setIsDeleting(false);
return;
} Risk Level 2 - /home/runner/work/quivr/quivr/frontend/lib/api/knowledge/knowledge.ts The code is generally well-written and follows good practices. However, there is a potential issue with error handling. When the 📚💣🔧 Powered by Code Review GPT |
4d12e2e
to
3aeef9c
Compare
3aeef9c
to
8778b58
Compare
8778b58
to
3b1528d
Compare
...omponents/BrainManagementTabs/components/KnowledgeTab/KnowledgeItem/CrawledKnowledgeItem.tsx
Fixed
Show fixed
Hide fixed
b6c8c59
to
bbcf002
Compare
|
||
const canDeleteFile = currentBrain?.role === "Owner"; | ||
|
||
console.log("isDeleting", isDeleting); |
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.
👀
return ( | ||
<a | ||
onClick={() => void downloadFile()} | ||
style={{ display: "flex", flexDirection: "column", alignItems: "center" }} |
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.
👀
|
||
export const UploadedKnowledgeItem = ({ | ||
knowledge, | ||
}: { |
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.
Seems to have many things in common with CrawledKnowledgeItem
...
Maybe managing isUploadedKnowledge
in another way ?
}; | ||
|
||
KnowledgeItem.displayName = "KnowledgeItem"; | ||
export default KnowledgeItem; |
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.
👀
}); | ||
console.error(`Error deleting ${knowledge_name ?? ""}`, error); | ||
} | ||
setIsDeleting(false); |
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.
Seems ok but inside finally
should be better
|
||
const { getAllKnowledge } = useKnowledgeApi(); | ||
const { data: brainKnowledges, isLoading: isPending } = useQuery({ | ||
queryKey: [getKnowledgeDataKey(brainId)], |
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.
Nice 🤩
@@ -19,7 +20,7 @@ const Layout = ({ children }: LayoutProps): JSX.Element => { | |||
return ( | |||
<div className="relative h-full w-full flex justify-stretch items-stretch"> | |||
<BrainsList /> | |||
{children} | |||
<KnowledgeProvider>{children}</KnowledgeProvider> |
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.
KnowledgeProvider
seems to have be added 2 times
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.
KnowledgeTab/index.tsx
too
@@ -0,0 +1,6 @@ | |||
import { UUID } from "crypto"; | |||
|
|||
const brainDataKey = "quivr-knowledge"; |
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.
👀
}: { | ||
children: React.ReactNode; | ||
}): JSX.Element => { | ||
const [allKnowledge, setAllKnowledge] = useState<Knowledge[]>([]); |
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.
It appears that allKnowledge
is not being used. A new state has been introduced in useknowledgeTab
, which is conflicting with this
Right ?
}; | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
export const useKnowledgeTab = ({ brainId }: useKnowledgeTabProps) => { | ||
const [allKnowledge, setAllKnowledge] = useState<Knowledge[]>([]); |
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.
replace get and set from the context
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Checklist before requesting a review
Please delete options that are not relevant.
Screenshots (if appropriate):