feat(database): enhance DatabaseQueryTool with search scope filtering
- Updated DatabaseQueryTool to accept search targets during initialization. - Implemented search scope filtering in SQL validation to restrict queries to specified knowledge bases and documents. - Enhanced the SQL validation process to include new filtering options for improved security and query accuracy.
This commit is contained in:
@@ -395,7 +395,7 @@ func (s *agentService) registerTools(
|
||||
case tools.ToolGetDocumentInfo:
|
||||
toolToRegister = tools.NewGetDocumentInfoTool(s.knowledgeService, s.chunkService, config.SearchTargets)
|
||||
case tools.ToolDatabaseQuery:
|
||||
toolToRegister = tools.NewDatabaseQueryTool(s.db)
|
||||
toolToRegister = tools.NewDatabaseQueryTool(s.db, config.SearchTargets)
|
||||
case tools.ToolWebSearch:
|
||||
toolToRegister = tools.NewWebSearchTool(
|
||||
s.webSearchService,
|
||||
|
||||
Reference in New Issue
Block a user