feat(knowledgeBase): add knowledge graph rebuild and delete functionality
- Add deleteKnowledgeGraph and rebuildKnowledgeGraph API endpoints to knowledgeBase.ts - Add internationalization strings for rebuild confirmation dialog and success/failure messages in both English and Chinese - Implement rebuild mode logic in CreateModal component with confirmation dialog before rebuilding - Add originalType state tracking to distinguish between rebuild and regular edit modes - Update handleSave to trigger graph deletion and rebuild when in rebuild mode with graphrag enabled - Add handleDeleteGraph method to delete existing knowledge graph data before rebuild - Update performSave to use correct type value during save operation in rebuild mode - Enhance Private.tsx to refresh knowledge base details after table data refresh - Import new API functions (deleteKnowledgeGraph, rebuildKnowledgeGraph) in CreateModal - Update KnowledgeGraphCard component timestamp in file header
This commit is contained in:
@@ -295,4 +295,14 @@ export const getKnowledgeGraph = async (kb_id: string) => {
|
||||
export const getKnowledgeGraphEntityTypes = async (query: any) => {
|
||||
const response = await request.get(`${apiPrefix}/knowledges/knowledge_graph_entity_types`,query);
|
||||
return response ;
|
||||
};
|
||||
// 删除图谱
|
||||
export const deleteKnowledgeGraph = async (kb_id: string) => {
|
||||
const response = await request.delete(`${apiPrefix}/knowledges/${kb_id}/knowledge_graph`);
|
||||
return response;
|
||||
};
|
||||
// 知识库图谱重建
|
||||
export const rebuildKnowledgeGraph = async (kb_id: string) => {
|
||||
const response = await request.post(`${apiPrefix}/knowledges/${kb_id}/knowledge_graph`);
|
||||
return response;
|
||||
};
|
||||
Reference in New Issue
Block a user