mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
fix: try to get the first tool input directory when Agent return a list of inputs
This commit is contained in:
@@ -163,6 +163,14 @@ class CrewAgentParser:
|
||||
if result in UNABLE_TO_REPAIR_JSON_RESULTS:
|
||||
return tool_input
|
||||
|
||||
# if isinstance(result, str) and result.startswith("[") and result.endswith("]"):
|
||||
# try:
|
||||
# result_data = json.loads(result)
|
||||
# if isinstance(result_data, list) and len(result_data) > 0 and isinstance(result_data[0], dict):
|
||||
# return json.dumps(result_data[0])
|
||||
# except Exception:
|
||||
# ...
|
||||
|
||||
return str(result)
|
||||
|
||||
def _clean_agent_observations(self, text: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user