mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
Overridding classes __repr__
This commit is contained in:
@@ -318,3 +318,6 @@ class Agent(BaseModel):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def __tools_names(tools) -> str:
|
def __tools_names(tools) -> str:
|
||||||
return ", ".join([t.name for t in tools])
|
return ", ".join([t.name for t in tools])
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f"Agent(role={self.role}, goal={self.goal}, backstory={self.backstory})"
|
||||||
|
|||||||
@@ -287,3 +287,6 @@ class Crew(BaseModel):
|
|||||||
if self.max_rpm:
|
if self.max_rpm:
|
||||||
self._rpm_controller.stop_rpm_counter()
|
self._rpm_controller.stop_rpm_counter()
|
||||||
self._telemetry.end_crew(self, output)
|
self._telemetry.end_crew(self, output)
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f"Crew(id={self.id}, process={self.process}, number_of_agents={len(self.agents)}, number_of_tasks={len(self.tasks)})"
|
||||||
|
|||||||
@@ -244,3 +244,6 @@ class Task(BaseModel):
|
|||||||
with open(self.output_file, "w") as file:
|
with open(self.output_file, "w") as file:
|
||||||
file.write(result)
|
file.write(result)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f"Task(description={self.description}, expected_output={self.expected_output})"
|
||||||
|
|||||||
Reference in New Issue
Block a user