Open Wenlin88 opened 4 months ago
Root Cause Identified: I think the issue lies in the tool_usage.py module of the CrewAI library. The Printer class is used to print tool outputs without checking the agent's verbose setting.
Details: The ToolUsage class in tool_usage.py does not respect the agent's verbose parameter. This results in tool outputs being printed in the execution logs even when verbose=False.
Proposed Solution: Modify the ToolUsage class to include checks for self.agent.verbose before printing tool outputs. Here is an example of the necessary change:
if self.agent.verbose:
self._printer.print(content=f"\n\n{error}\n", color="red")
# Similarly, other print statements should be updated to check self.agent.verbose
Fixed by pull request #990
Description: When setting the
verbose
parameter toFalse
for an agent, the expectation is that the tool outputs should not be shown in the execution logs. However, I have observed that the tool output is still displayed. This issue persists regardless of theverbose
setting.Steps to Reproduce:
verbose=False
and assign the custom tool and Azure LLM to it.Example Code:
Expected Behavior:
When verbose=False, the tool output should not be shown in the execution logs.
Observed Behavior:
The tool output "This gets printed even if the verbose is off." is still shown even when verbose=False.
My environment details:
Operating System: Windows 11 Python version: 3.11.5 CrewAI version: 0.36.0