feat: 增强知识库和搜索功能的逻辑

This commit is contained in:
wizardchen
2025-12-22 11:23:25 +08:00
committed by lyingbug
parent f7900a5e9a
commit 3c83cf9873
4 changed files with 50 additions and 8 deletions
@@ -195,6 +195,11 @@ func (s *agentService) registerTools(
"database_query": true,
}
// If no knowledge and no web search, also disable todo_write (not useful for simple chat)
if !config.WebSearchEnabled {
kbTools["todo_write"] = true
}
for _, toolName := range allowedTools {
if !kbTools[toolName] {
filteredTools = append(filteredTools, toolName)