Feat: Modify the parsing method string to an enumeration type. #5467 (#5468)

### What problem does this PR solve?

Feat: Modify the parsing method string to an enumeration type. #5467

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-02-28 11:13:56 +08:00
committed by GitHub
parent 5fdfb8d465
commit b2a5482d2c
6 changed files with 135 additions and 84 deletions

View File

@ -16,6 +16,7 @@ import ParseConfiguration, {
import GraphRagItems, {
showGraphRagItems,
} from '@/components/parse-configuration/graph-rag-items';
import { DocumentParserType } from '@/constants/knowledge';
import { useTranslate } from '@/hooks/common-hooks';
import { useHandleChunkMethodSelectChange } from '@/hooks/logic-hooks';
import { normFile } from '@/utils/file-util';
@ -127,7 +128,7 @@ const ConfigurationForm = ({ form }: { form: FormInstance }) => {
return (
<>
{parserId === 'knowledge_graph' && (
{parserId === DocumentParserType.KnowledgeGraph && (
<>
<EntityTypesItem></EntityTypesItem>
<MaxTokenNumber max={8192 * 2}></MaxTokenNumber>
@ -140,7 +141,7 @@ const ConfigurationForm = ({ form }: { form: FormInstance }) => {
<AutoQuestionsItem></AutoQuestionsItem>
</>
)}
{parserId === 'naive' && (
{parserId === DocumentParserType.Naive && (
<>
<MaxTokenNumber></MaxTokenNumber>
<Delimiter></Delimiter>