From c13b08de2eb63a69ba2d077189fa2ea98c5373f7 Mon Sep 17 00:00:00 2001 From: Lucas Gomide Date: Fri, 20 Jun 2025 12:09:45 -0300 Subject: [PATCH] fix: add support for case-insensitive Enterprise filter (#340) --- .../tools/crewai_enterprise_tools/crewai_enterprise_tools.py | 2 +- tests/tools/crewai_enterprise_tools_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crewai_tools/tools/crewai_enterprise_tools/crewai_enterprise_tools.py b/src/crewai_tools/tools/crewai_enterprise_tools/crewai_enterprise_tools.py index 8e7275e69..871cf7c94 100644 --- a/src/crewai_tools/tools/crewai_enterprise_tools/crewai_enterprise_tools.py +++ b/src/crewai_tools/tools/crewai_enterprise_tools/crewai_enterprise_tools.py @@ -53,5 +53,5 @@ def CrewaiEnterpriseTools( return ToolCollection(all_tools) # Filter tools based on the provided list - filtered_tools = [tool for tool in all_tools if tool.name in actions_list] + filtered_tools = [tool for tool in all_tools if tool.name.lower() in [action.lower() for action in actions_list]] return ToolCollection(filtered_tools) diff --git a/tests/tools/crewai_enterprise_tools_test.py b/tests/tools/crewai_enterprise_tools_test.py index 384093e0f..7a649028d 100644 --- a/tests/tools/crewai_enterprise_tools_test.py +++ b/tests/tools/crewai_enterprise_tools_test.py @@ -46,7 +46,7 @@ class TestCrewaiEnterpriseTools(unittest.TestCase): @patch.dict(os.environ, {"CREWAI_ENTERPRISE_TOOLS_TOKEN": "env-token"}) def test_filters_tools_by_actions_list(self): - tools = CrewaiEnterpriseTools(actions_list=["tool1", "tool3"]) + tools = CrewaiEnterpriseTools(actions_list=["ToOl1", "tool3"]) self.assertEqual(len(tools), 2) self.assertEqual(tools[0].name, "tool1") self.assertEqual(tools[1].name, "tool3")