@@ -9,7 +9,15 @@ const props = defineProps<{
9
9
title: string
10
10
type: OperateType
11
11
data? : KnowledgeBase
12
- embeddings: string []
12
+ embeddings: string [],
13
+ chunking: {
14
+ parentChunkSize: number ,
15
+ parentChunkOverlap: number ,
16
+ childChunkSize: number ,
17
+ childChunkOverlap: number ,
18
+ parentK: number ,
19
+ childK: number ,
20
+ }
13
21
onSuccess: () => void
14
22
onClose: () => void
15
23
}>()
@@ -28,6 +36,14 @@ const state = reactive({
28
36
pageParser: ' default' as PageParser ,
29
37
maxDepth: 0 ,
30
38
excludeGlobs: ' ' ,
39
+ chunking: {
40
+ parentChunkSize: props .chunking .parentChunkSize ,
41
+ parentChunkOverlap: props .chunking .parentChunkOverlap ,
42
+ childChunkSize: props .chunking .childChunkSize ,
43
+ childChunkOverlap: props .chunking .childChunkOverlap ,
44
+ parentK: props .chunking .parentK ,
45
+ childK: props .chunking .childK ,
46
+ }
31
47
})
32
48
const loading = ref (false )
33
49
const isModify = computed (() => props .type === ' update' )
@@ -81,6 +97,7 @@ async function onSubmit() {
81
97
formData .append (" pageParser" , state .pageParser )
82
98
formData .append (" maxDepth" , String (state .maxDepth ))
83
99
formData .append (" excludeGlobs" , state .excludeGlobs )
100
+ formData .append (" chunking" , JSON .stringify (state .chunking ))
84
101
85
102
if (isModify .value ) {
86
103
formData .append (' knowledgeBaseId' , String (props .data ! .id ))
@@ -168,6 +185,29 @@ function generateEmbeddingData(groupName: string, list: string[], slotName: stri
168
185
<UTextarea autoresize :maxrows =" 4" v-model =" state.description" />
169
186
</UFormGroup >
170
187
188
+ <UFormGroup :label =" t('knowledgeBases.chunking')" name =" chunking" class =" mb-4" >
189
+ <div class =" grid grid-cols-2 gap-4" >
190
+ <UFormGroup label =" Parent Chunk Size" name =" parentChunkSize" >
191
+ <UInput v-model =" state.chunking.parentChunkSize" type =" number" />
192
+ </UFormGroup >
193
+ <UFormGroup label =" Parent Chunk Overlap" name =" parentChunkOverlap" >
194
+ <UInput v-model =" state.chunking.parentChunkOverlap" type =" number" />
195
+ </UFormGroup >
196
+ <UFormGroup label =" Child Chunk Size" name =" childChunkSize" >
197
+ <UInput v-model =" state.chunking.childChunkSize" type =" number" />
198
+ </UFormGroup >
199
+ <UFormGroup label =" Child Chunk Overlap" name =" childChunkOverlap" >
200
+ <UInput v-model =" state.chunking.childChunkOverlap" type =" number" />
201
+ </UFormGroup >
202
+ <UFormGroup label =" Parent K" name =" parentK" >
203
+ <UInput v-model =" state.chunking.parentK" type =" number" />
204
+ </UFormGroup >
205
+ <UFormGroup label =" Child K" name =" childK" >
206
+ <UInput v-model =" state.chunking.childK" type =" number" />
207
+ </UFormGroup >
208
+ </div >
209
+ </UFormGroup >
210
+
171
211
<UFormGroup :label =" t('knowledgeBases.publicAccessible')" name =" public" class =" mb-4" >
172
212
<p class =" text-xs mb-2 text-pink-600 dark:text-pink-300" >{{ t("knowledgeBases.publicAccessibleTip") }}</p >
173
213
<UToggle v-model =" state.isPublic" />
0 commit comments