add support for built in tool type

This commit is contained in:
Dinesh Yeduguru 2024-12-23 16:50:03 -08:00
parent 517bc9ebea
commit 1a66ddc1b5
8 changed files with 83 additions and 75 deletions

View file

@ -621,6 +621,9 @@ class ChatAgent(ShieldRunnerMixin):
ret = []
for tool_name in self.agent_config.available_tools:
tool = await self.tool_groups_api.get_tool(tool_name)
if tool.built_in_type:
ret.append(ToolDefinition(tool_name=tool.built_in_type))
continue
params = {}
for param in tool.parameters:
params[param.name] = ToolParamDefinition(

View file

@ -25,8 +25,7 @@ class BraveSearchToolRuntimeImpl(
pass
async def register_tool(self, tool: Tool):
if tool.identifier != "brave_search":
raise ValueError(f"Tool identifier {tool.identifier} is not supported")
pass
async def unregister_tool(self, tool_id: str) -> None:
return

View file

@ -26,8 +26,7 @@ class TavilySearchToolRuntimeImpl(
pass
async def register_tool(self, tool: Tool):
if tool.identifier != "tavily_search":
raise ValueError(f"Tool identifier {tool.identifier} is not supported")
pass
async def unregister_tool(self, tool_id: str) -> None:
return