Enhance knowledge base configuration by normalizing and validating custom instruction fields. Implemented length checks for prompt instructions and added tests for validation logic. Updated GraphSettings to retain custom instructions when extraction is disabled.

This commit is contained in:
wizardchen
2026-07-13 12:14:36 +08:00
committed by lyingbug
parent c1cddb4d4d
commit 5eefa70e6f
9 changed files with 158 additions and 35 deletions
@@ -403,13 +403,12 @@ const handleConfigChange = () => {
// 处理启用/禁用切换
const handleEnabledChange = () => {
// 当关闭提取功能时,清空所有数据
// 当关闭提取功能时,清空示例数据,但保留自定义指令以便再次启用时恢复。
if (!localGraphExtract.value.enabled) {
localGraphExtract.value.text = ''
localGraphExtract.value.tags = []
localGraphExtract.value.nodes = []
localGraphExtract.value.relations = []
localGraphExtract.value.customInstructions = ''
}
handleConfigChange()
}