eaglelandsonce commited on
Commit
91e16a7
1 Parent(s): 81114f1

Upload 2 files

Browse files
crewai/tasks/__init__.py ADDED
File without changes
crewai/tasks/task_output.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Optional
2
+
3
+ from pydantic import BaseModel, Field, model_validator
4
+
5
+
6
+ class TaskOutput(BaseModel):
7
+ """Class that represents the result of a task."""
8
+
9
+ description: str = Field(description="Description of the task")
10
+ summary: Optional[str] = Field(description="Summary of the task", default=None)
11
+ result: str = Field(description="Result of the task")
12
+
13
+ @model_validator(mode="after")
14
+ def set_summary(self):
15
+ excerpt = " ".join(self.description.split(" ")[:10])
16
+ self.summary = f"{excerpt}..."
17
+ return self