diff --git a/llama_stack/distribution/routers/routing_tables.py b/llama_stack/distribution/routers/routing_tables.py index 7aef2f8d5..6277096d8 100644 --- a/llama_stack/distribution/routers/routing_tables.py +++ b/llama_stack/distribution/routers/routing_tables.py @@ -575,7 +575,7 @@ class ToolGroupsRoutingTable(CommonRoutingTableImpl, ToolGroups): tool_group = await self.get_tool_group(toolgroup_id) if tool_group is None: raise ValueError(f"Tool group {toolgroup_id} not found") - tools = await self.list_tools(toolgroup_id).data + tools = (await self.list_tools(toolgroup_id)).data for tool in tools: await self.unregister_object(tool) await self.unregister_object(tool_group) diff --git a/tests/integration/tools/test_tools.py b/tests/integration/tools/test_tools.py new file mode 100644 index 000000000..162669bb4 --- /dev/null +++ b/tests/integration/tools/test_tools.py @@ -0,0 +1,12 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + + +def test_toolsgroups_unregister(llama_stack_client): + client = llama_stack_client + client.toolgroups.unregister( + toolgroup_id="builtin::websearch", + )