forked from crewAIInc/crewAI-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
41 lines (32 loc) · 1.15 KB
/
tasks.py
File metadata and controls
41 lines (32 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# To know more about the Task class, visit: https://docs.crewai.com/concepts/tasks
from crewai import Task
from textwrap import dedent
class CustomTasks:
def __tip_section(self):
return "If you do your BEST WORK, I'll give you a $10,000 commission!"
def task_1_name(self, agent, var1, var2):
return Task(
description=dedent(
f"""
Do something as part of task 1
{self.__tip_section()}
Make sure to use the most recent data as possible.
Use this variable: {var1}
And also this variable: {var2}
"""
),
expected_output="The expected output of the task",
agent=agent,
)
def task_2_name(self, agent):
return Task(
description=dedent(
f"""
Take the input from task 1 and do something with it.
{self.__tip_section()}
Make sure to do something else.
"""
),
expected_output="The expected output of the task",
agent=agent,
)