-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtasks.py
47 lines (38 loc) · 1.66 KB
/
tasks.py
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
42
43
44
45
46
47
from crewai import Task
from textwrap import dedent
from agents import MelodyAgents
from crewai import Agent
class MelodyTasks:
def web_research_task(self, agent: Agent, topic: str):
return Task(
description=dedent(f"""
Conduct a web research about the next topic:
```
{topic}
```
Your final answer must be a detailed report about the
topic, gathering all relevant information and details
about it
"""),
expected_output=dedent("A detailed report of the topic"),
agent=agent)
def lyrics_creation_task(self, agent: Agent, topic: str, genre: str):
return Task(
description=dedent("""
Create high quality lyrics for a {genre} song about the next topic:
```
{topic}
```
Use the information gathered by the previous agent and adapt the
writing style to following music: {genre}.
Your final answer must be the lyrics of the song, and nothing else.
"""),
expected_output="The lyrics of the song, and nothing else",
agent=agent
)
def song_generation_task(self, agent: Agent):
return Task(
description="Generate a song from the provided lyrics",
expected_output="Show the user the urls for checking the generated songs",
agent=agent
)