feat: Add KnowledgeGraphModal #162 (#1766)

### What problem does this PR solve?

feat: Add KnowledgeGraphModal #162

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-08-01 17:27:27 +08:00
committed by GitHub
parent 50e9df4c76
commit e37b0d217d
13 changed files with 664 additions and 251 deletions

View File

@ -206,3 +206,22 @@ export const useFetchChunk = (chunkId?: string): ResponseType<any> => {
return data;
};
export const useFetchKnowledgeGraph = (): ResponseType<any> => {
const { documentId } = useGetKnowledgeSearchParams();
const { data } = useQuery({
queryKey: ['fetchKnowledgeGraph', documentId],
initialData: true,
gcTime: 0,
queryFn: async () => {
const data = await kbService.knowledge_graph({
doc_id: documentId,
});
return data;
},
});
return data;
};