feat: 支持知识库选择模式和标题生成模型配置

- 移除对rerankModel的强制检查,支持无知识库场景
- 优化知识库解析逻辑,优先处理用户明确指定的知识库
This commit is contained in:
wizardchen
2025-12-29 14:35:13 +08:00
parent 6bc19ab082
commit 6c8e261a5f
6 changed files with 92 additions and 44 deletions
@@ -83,9 +83,8 @@ func (s *agentService) CreateAgentEngine(
return nil, fmt.Errorf("chat model is nil after initialization")
}
if rerankModel == nil {
return nil, fmt.Errorf("rerank model is nil after initialization")
}
// Note: rerankModel can be nil when no knowledge bases are configured
// The registerTools function will filter out knowledge-related tools in this case
// Create tool registry
toolRegistry := tools.NewToolRegistry(s.knowledgeService, s.chunkService, s.db)