Feat: Support deleting knowledge graph #6747 (#6748)

### What problem does this PR solve?

Feat: Support deleting knowledge graph #6747

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-04-02 11:20:37 +08:00
committed by GitHub
parent 3ae1e9e3c4
commit fc02929946
6 changed files with 90 additions and 14 deletions

View File

@ -32,7 +32,8 @@ import LayoutRecognize from '../layout-recognize';
import ParseConfiguration, {
showRaptorParseConfiguration,
} from '../parse-configuration';
import GraphRagItems, {
import {
UseGraphRagItem,
showGraphRagItems,
} from '../parse-configuration/graph-rag-items';
import styles from './index.less';
@ -316,7 +317,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
<ParseConfiguration></ParseConfiguration>
</DatasetConfigurationContainer>
)}
{showGraphRagItems(selectedTag) && <GraphRagItems></GraphRagItems>}
{showGraphRagItems(selectedTag) && <UseGraphRagItem></UseGraphRagItem>}
{showEntityTypes && <EntityTypesItem></EntityTypesItem>}
</Form>
</Modal>

View File

@ -39,6 +39,22 @@ type GraphRagItemsProps = {
marginBottom?: boolean;
};
export function UseGraphRagItem() {
const { t } = useTranslate('knowledgeConfiguration');
return (
<Form.Item
name={['parser_config', 'graphrag', 'use_graphrag']}
label={t('useGraphRag')}
initialValue={false}
valuePropName="checked"
tooltip={t('useGraphRagTip')}
>
<Switch />
</Form.Item>
);
}
// The three types "table", "resume" and "one" do not display this configuration.
const GraphRagItems = ({ marginBottom = false }: GraphRagItemsProps) => {
const { t } = useTranslate('knowledgeConfiguration');
@ -62,15 +78,7 @@ const GraphRagItems = ({ marginBottom = false }: GraphRagItemsProps) => {
return (
<DatasetConfigurationContainer className={cn({ 'mb-4': marginBottom })}>
<Form.Item
name={['parser_config', 'graphrag', 'use_graphrag']}
label={t('useGraphRag')}
initialValue={false}
valuePropName="checked"
tooltip={t('useGraphRagTip')}
>
<Switch />
</Form.Item>
<UseGraphRagItem></UseGraphRagItem>
<Form.Item
shouldUpdate={(prevValues, curValues) =>
prevValues.parser_config.graphrag.use_graphrag !==