mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 23:58:34 +00:00
fix: move agent tools for a variable instead of use format (#2319)
Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
This commit is contained in:
@@ -96,6 +96,10 @@ class CrewPlanner:
|
|||||||
tasks_summary = []
|
tasks_summary = []
|
||||||
for idx, task in enumerate(self.tasks):
|
for idx, task in enumerate(self.tasks):
|
||||||
knowledge_list = self._get_agent_knowledge(task)
|
knowledge_list = self._get_agent_knowledge(task)
|
||||||
|
agent_tools = (
|
||||||
|
f"[{', '.join(str(tool) for tool in task.agent.tools)}]" if task.agent and task.agent.tools else '"agent has no tools"',
|
||||||
|
f',\n "agent_knowledge": "[\\"{knowledge_list[0]}\\"]"' if knowledge_list and str(knowledge_list) != "None" else ""
|
||||||
|
)
|
||||||
task_summary = f"""
|
task_summary = f"""
|
||||||
Task Number {idx + 1} - {task.description}
|
Task Number {idx + 1} - {task.description}
|
||||||
"task_description": {task.description}
|
"task_description": {task.description}
|
||||||
@@ -103,10 +107,7 @@ class CrewPlanner:
|
|||||||
"agent": {task.agent.role if task.agent else "None"}
|
"agent": {task.agent.role if task.agent else "None"}
|
||||||
"agent_goal": {task.agent.goal if task.agent else "None"}
|
"agent_goal": {task.agent.goal if task.agent else "None"}
|
||||||
"task_tools": {task.tools}
|
"task_tools": {task.tools}
|
||||||
"agent_tools": %s%s""" % (
|
"agent_tools": {"".join(agent_tools)}"""
|
||||||
f"[{', '.join(str(tool) for tool in task.agent.tools)}]" if task.agent and task.agent.tools else '"agent has no tools"',
|
|
||||||
f',\n "agent_knowledge": "[\\"{knowledge_list[0]}\\"]"' if knowledge_list and str(knowledge_list) != "None" else ""
|
|
||||||
)
|
|
||||||
|
|
||||||
tasks_summary.append(task_summary)
|
tasks_summary.append(task_summary)
|
||||||
return " ".join(tasks_summary)
|
return " ".join(tasks_summary)
|
||||||
|
|||||||
Reference in New Issue
Block a user