From 8119363e56daa121394c2f5f9906cfc1416a21b2 Mon Sep 17 00:00:00 2001 From: Aidan Do Date: Sat, 21 Dec 2024 22:40:29 +1100 Subject: [PATCH] Agents: Avoid calling tools that haven't been explicitly enabled --- .../providers/inline/agents/meta_reference/agent_instance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py index d7930550d7..737589ce5c 100644 --- a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py +++ b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py @@ -539,7 +539,7 @@ async def _run( tool_call = message.tool_calls[0] name = tool_call.tool_name - if not isinstance(name, BuiltinTool): + if not isinstance(name, BuiltinTool) or name not in enabled_tools: yield message return