diff --git a/src/crewai/agents/crew_agent_executor.py b/src/crewai/agents/crew_agent_executor.py index 1377482ad..1b4b42652 100644 --- a/src/crewai/agents/crew_agent_executor.py +++ b/src/crewai/agents/crew_agent_executor.py @@ -130,7 +130,6 @@ class CrewAgentExecutor(CrewAgentExecutorMixin): try: self._format_answer(answer) except OutputParserException as e: - print("ERROR ATTEMPTING TO PARSE ANSWER: ", answer) if ( FINAL_ANSWER_AND_PARSABLE_ACTION_ERROR_MESSAGE in e.error diff --git a/src/crewai/tools/tool_usage.py b/src/crewai/tools/tool_usage.py index b0ae69f78..6d06d202a 100644 --- a/src/crewai/tools/tool_usage.py +++ b/src/crewai/tools/tool_usage.py @@ -403,18 +403,13 @@ class ToolUsage: arguments = json.loads(tool_input) except json.JSONDecodeError: # Fix common issues in the tool_input string - - # Replace single quotes with double quotes tool_input = tool_input.replace("'", '"') - # Replace 'None' strings with null tool_input = tool_input.replace('"None"', "null") - # Use json_repair to fix common JSON issues repaired_input = repair_json(tool_input) try: arguments = json.loads(repaired_input) except json.JSONDecodeError as e: - # If all else fails, raise an error raise Exception(f"Invalid tool input JSON: {e}") return arguments