mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-07 15:18:29 +00:00
fix: add support for case-insensitive Enterprise filter (#340)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user