refactor: remove enable_multimodal and adjust parent-child configuration
- Removed the `enable_multimodal` field from the `ChunkingConfigOverride` interface and related components to streamline configuration. - Updated the logic in `UploadConfirmDialog.vue` to default `enableParentChild` to false when initializing from knowledge base info. - Modified the `mergeChunkingConfig` function to ensure that `EnableParentChild` is authoritative, allowing explicit control over its state. - Added a new test case in `knowledge_process_config_test.go` to verify the behavior of parent-child toggles in process configuration resolution.
This commit is contained in:
@@ -34,6 +34,28 @@ func TestResolveProcessConfig_OverridesChunkSize(t *testing.T) {
|
||||
require.Equal(t, 50, eff.ChunkingConfig.ChunkOverlap)
|
||||
}
|
||||
|
||||
func TestResolveProcessConfig_OverrideTogglesParentChild(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
// KB has parent-child on; override snapshot turns it off.
|
||||
kbOn := &types.KnowledgeBase{
|
||||
ChunkingConfig: types.ChunkingConfig{ChunkSize: 512, EnableParentChild: true},
|
||||
}
|
||||
effOff := ResolveProcessConfig(kbOn, &types.KnowledgeProcessOverrides{
|
||||
ChunkingConfig: &types.ChunkingConfig{ChunkSize: 512, EnableParentChild: false},
|
||||
})
|
||||
require.False(t, effOff.ChunkingConfig.EnableParentChild)
|
||||
|
||||
// KB has parent-child off; override snapshot turns it on.
|
||||
kbOff := &types.KnowledgeBase{
|
||||
ChunkingConfig: types.ChunkingConfig{ChunkSize: 512, EnableParentChild: false},
|
||||
}
|
||||
effOn := ResolveProcessConfig(kbOff, &types.KnowledgeProcessOverrides{
|
||||
ChunkingConfig: &types.ChunkingConfig{ChunkSize: 512, EnableParentChild: true},
|
||||
})
|
||||
require.True(t, effOn.ChunkingConfig.EnableParentChild)
|
||||
}
|
||||
|
||||
func TestResolveProcessConfig_GraphDisabled(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -70,7 +92,6 @@ func TestResolveProcessConfig_NilOverridesUsesKBDefaults(t *testing.T) {
|
||||
IndexingStrategy: types.IndexingStrategy{GraphEnabled: true},
|
||||
ExtractConfig: &types.ExtractConfig{Enabled: true, Tags: []string{"tag-a"}},
|
||||
}
|
||||
kb.ChunkingConfig.EnableMultimodal = true
|
||||
|
||||
eff := ResolveProcessConfig(kb, nil)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user