From 720e06ab6b211df6706765f186e99d425051f331 Mon Sep 17 00:00:00 2001 From: Vardaan Grover Date: Fri, 24 Jan 2025 14:41:36 +0530 Subject: [PATCH] added print statement for tool delegation for debugging --- src/crewai/crew.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/crewai/crew.py b/src/crewai/crew.py index 125edde18..1d4a65608 100644 --- a/src/crewai/crew.py +++ b/src/crewai/crew.py @@ -868,7 +868,11 @@ class Crew(BaseModel): # tools, task.agent, agents_for_delegation # ) # return tools + print(f"Current agent: {task.agent.role}") + print(f"Allow delegation: {task.agent.allow_delegation}") + print(f"Allowed agents: {task.agent.allowed_agents}") if not task.agent or not task.agent.allow_delegation: + print("Delegation not allowed for this agent") return tools agents_for_delegation = [] @@ -877,6 +881,7 @@ class Crew(BaseModel): continue if task.agent.allowed_agents is None or agent.role in task.agent.allowed_agents: agents_for_delegation.append(agent) + print(f"Added {agent.role} to delegation list") if agents_for_delegation: if not tools: tools = []