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
+5 -1
View File
@@ -626,7 +626,11 @@ func (s *DataTableSummaryService) processTableData(ctx context.Context, resource
// 使用AI生成表格摘要和列描述
customInstructions := ""
if resources.knowledgeBase != nil {
customInstructions = resources.knowledgeBase.ChunkingConfig.TableMetadataInstructions
var processOverrides *types.KnowledgeProcessOverrides
if resources.knowledge != nil {
processOverrides, _ = resources.knowledge.ProcessOverrides()
}
customInstructions = ResolveProcessConfig(resources.knowledgeBase, processOverrides).ChunkingConfig.TableMetadataInstructions
}
tableDescription, err := s.generateTableDescription(ctx, resources.chatModel, tableSchema.TableName,
schemaDesc, sampleDesc, customInstructions)