remove prints and unnecessary comments

This commit is contained in:
Brandon Hancock
2025-01-08 17:10:07 -05:00
parent 26053c9d1a
commit 0dc2582ce1
2 changed files with 0 additions and 6 deletions

View File

@@ -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

View File

@@ -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