mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 23:58:34 +00:00
remove prints and unnecessary comments
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user