mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 08:38:30 +00:00
remove prints and unnecessary comments
This commit is contained in:
@@ -130,7 +130,6 @@ class CrewAgentExecutor(CrewAgentExecutorMixin):
|
|||||||
try:
|
try:
|
||||||
self._format_answer(answer)
|
self._format_answer(answer)
|
||||||
except OutputParserException as e:
|
except OutputParserException as e:
|
||||||
print("ERROR ATTEMPTING TO PARSE ANSWER: ", answer)
|
|
||||||
if (
|
if (
|
||||||
FINAL_ANSWER_AND_PARSABLE_ACTION_ERROR_MESSAGE
|
FINAL_ANSWER_AND_PARSABLE_ACTION_ERROR_MESSAGE
|
||||||
in e.error
|
in e.error
|
||||||
|
|||||||
@@ -403,18 +403,13 @@ class ToolUsage:
|
|||||||
arguments = json.loads(tool_input)
|
arguments = json.loads(tool_input)
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
# Fix common issues in the tool_input string
|
# Fix common issues in the tool_input string
|
||||||
|
|
||||||
# Replace single quotes with double quotes
|
|
||||||
tool_input = tool_input.replace("'", '"')
|
tool_input = tool_input.replace("'", '"')
|
||||||
# Replace 'None' strings with null
|
|
||||||
tool_input = tool_input.replace('"None"', "null")
|
tool_input = tool_input.replace('"None"', "null")
|
||||||
|
|
||||||
# Use json_repair to fix common JSON issues
|
|
||||||
repaired_input = repair_json(tool_input)
|
repaired_input = repair_json(tool_input)
|
||||||
try:
|
try:
|
||||||
arguments = json.loads(repaired_input)
|
arguments = json.loads(repaired_input)
|
||||||
except json.JSONDecodeError as e:
|
except json.JSONDecodeError as e:
|
||||||
# If all else fails, raise an error
|
|
||||||
raise Exception(f"Invalid tool input JSON: {e}")
|
raise Exception(f"Invalid tool input JSON: {e}")
|
||||||
|
|
||||||
return arguments
|
return arguments
|
||||||
|
|||||||
Reference in New Issue
Block a user