refactor: convert to nl2sql skills

This commit is contained in:
qixinbo
2026-03-18 21:58:11 +08:00
parent e23cf33a97
commit a0e72111cd
6 changed files with 350 additions and 180 deletions
+9
View File
@@ -85,6 +85,14 @@ class NanobotIntegration:
channels_config=self.config.channels,
)
self._register_custom_tools(self.agent)
def _register_custom_tools(self, agent: AgentLoop):
from app.tools.nl2sql import NL2SQLTool
from app.tools.visualization import VisualizationTool
agent.tools.register(NL2SQLTool())
agent.tools.register(VisualizationTool())
def _make_provider(self, config: Config):
# Logic adapted from nanobot/cli/commands.py
model = config.agents.defaults.model
@@ -195,6 +203,7 @@ class NanobotIntegration:
provider_name=target_config.get("provider"),
)
agent = self._build_agent_for_provider(provider)
self._register_custom_tools(agent)
self._model_agent_cache[model_id] = agent
return agent