feat: update chunk size configurations for knowledge base processing

- Increased default sizes for parent and child chunks in the knowledge base editor and settings, enhancing data processing capabilities.
- Adjusted slider settings in the UI to reflect new minimum and maximum values for chunk sizes, improving user control over configurations.
- Updated backend logic to ensure consistent handling of chunk sizes across the application.

These changes optimize the chunking process, allowing for more efficient data handling and improved performance in knowledge base operations.
This commit is contained in:
wizardchen
2026-03-05 15:04:08 +08:00
committed by lyingbug
parent 2e48bc0e63
commit b697d4945e
4 changed files with 19 additions and 19 deletions
@@ -298,8 +298,8 @@ const initFormData = (type: 'document' | 'faq' = 'document') => {
separators: ['\n\n', '\n', '。', '!', '?', ';', ';'],
parserEngineRules: undefined as any,
enableParentChild: false,
parentChunkSize: 1024,
childChunkSize: 256
parentChunkSize: 4096,
childChunkSize: 384
},
storageProvider: 'local' as string,
multimodalConfig: {
@@ -378,8 +378,8 @@ const loadKBData = async () => {
separators: kb.chunking_config?.separators || ['\n\n', '\n', '。', '!', '?', ';', ';'],
parserEngineRules: kb.chunking_config?.parser_engine_rules || undefined,
enableParentChild: kb.chunking_config?.enable_parent_child || false,
parentChunkSize: kb.chunking_config?.parent_chunk_size || 1024,
childChunkSize: kb.chunking_config?.child_chunk_size || 256
parentChunkSize: kb.chunking_config?.parent_chunk_size || 4096,
childChunkSize: kb.chunking_config?.child_chunk_size || 384
},
storageProvider: (kb.storage_config?.provider || 'local') as string,
multimodalConfig: {
@@ -614,8 +614,8 @@ const handleSubmit = async () => {
separators: data.chunking_config.separators,
parserEngineRules: data.chunking_config.parser_engine_rules || undefined,
enableParentChild: data.chunking_config.enable_parent_child || false,
parentChunkSize: data.chunking_config.parent_chunk_size || 1024,
childChunkSize: data.chunking_config.child_chunk_size || 256
parentChunkSize: data.chunking_config.parent_chunk_size || 4096,
childChunkSize: data.chunking_config.child_chunk_size || 384
},
multimodal: {
enabled: !!data.vlm_config?.enabled
@@ -94,10 +94,10 @@
<div class="slider-container">
<t-slider
v-model="localParentChunkSize"
:min="256"
:max="4096"
:min="512"
:max="8192"
:step="64"
:marks="{ 256: '256', 1024: '1024', 2048: '2048', 4096: '4096' }"
:marks="{ 512: '512', 2048: '2048', 4096: '4096', 8192: '8192' }"
@change="handleParentChunkSizeChange"
style="width: 200px;"
/>
@@ -117,9 +117,9 @@
<t-slider
v-model="localChildChunkSize"
:min="64"
:max="1024"
:max="2048"
:step="32"
:marks="{ 64: '64', 256: '256', 512: '512', 1024: '1024' }"
:marks="{ 64: '64', 384: '384', 1024: '1024', 2048: '2048' }"
@change="handleChildChunkSizeChange"
style="width: 200px;"
/>
@@ -164,8 +164,8 @@ const localChunkSize = ref(props.config.chunkSize)
const localChunkOverlap = ref(props.config.chunkOverlap)
const localSeparators = ref([...props.config.separators])
const localEnableParentChild = ref(props.config.enableParentChild ?? false)
const localParentChunkSize = ref(props.config.parentChunkSize || 1024)
const localChildChunkSize = ref(props.config.childChunkSize || 256)
const localParentChunkSize = ref(props.config.parentChunkSize || 4096)
const localChildChunkSize = ref(props.config.childChunkSize || 384)
const { t } = useI18n()
const separatorOptions = computed(() => [
@@ -184,8 +184,8 @@ watch(() => props.config, (newConfig) => {
localChunkOverlap.value = newConfig.chunkOverlap
localSeparators.value = [...newConfig.separators]
localEnableParentChild.value = newConfig.enableParentChild ?? false
localParentChunkSize.value = newConfig.parentChunkSize || 1024
localChildChunkSize.value = newConfig.childChunkSize || 256
localParentChunkSize.value = newConfig.parentChunkSize || 4096
localChildChunkSize.value = newConfig.childChunkSize || 384
}, { deep: true })
const handleChunkSizeChange = () => { emitUpdate() }