Update app.py
Browse files
app.py
CHANGED
|
@@ -56,6 +56,19 @@ def crewai_process(research_topic):
|
|
| 56 |
|
| 57 |
)
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
artist = Agent(
|
| 60 |
role='Storybook Illustrator',
|
| 61 |
goal="""Visually bring stories to life. Create images that complement and enhance the text,
|
|
@@ -135,28 +148,34 @@ def crewai_process(research_topic):
|
|
| 135 |
)
|
| 136 |
|
| 137 |
task2 = Task(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
description="""Divide the story into 8 parts and ensure itis engaging and resonates with children, making it a valuable and enjoyable reading experience.
|
| 139 |
""",
|
| 140 |
agent=editor
|
| 141 |
)
|
| 142 |
|
| 143 |
|
| 144 |
-
|
| 145 |
description="""Summarize the author story into an image prompt.""",
|
| 146 |
agent=artist
|
| 147 |
)
|
| 148 |
|
| 149 |
-
|
| 150 |
description="""create a rhyming version of the story created by the author""",
|
| 151 |
agent=poet
|
| 152 |
)
|
| 153 |
|
| 154 |
-
|
| 155 |
description="""create a rhyming version of the story created by the author""",
|
| 156 |
agent=reader
|
| 157 |
)
|
| 158 |
|
| 159 |
-
|
| 160 |
description="""output both the story created by the author and the poem created by the poet,
|
| 161 |
make sure you label the story and the poem so you can tell them apart, name the story and poem appropriately """,
|
| 162 |
agent=finalizer
|
|
@@ -167,7 +186,7 @@ def crewai_process(research_topic):
|
|
| 167 |
|
| 168 |
# Instantiate your crew with a sequential process
|
| 169 |
crew = Crew(
|
| 170 |
-
agents=[author,
|
| 171 |
tasks=[task1, task2],
|
| 172 |
verbose=2,
|
| 173 |
process=Process.sequential
|
|
|
|
| 56 |
|
| 57 |
)
|
| 58 |
|
| 59 |
+
illustrator = Agent(
|
| 60 |
+
role='Children Story Illustrator',
|
| 61 |
+
goal="""Your primary goal is to bring children's stories to life through captivating and age-appropriate illustrations. . """,
|
| 62 |
+
backstory="""You have a passion for drawing and storytelling. As a child, you loved reading fairy tales and imagining vivid
|
| 63 |
+
worlds filled with adventure and wonder. This love for stories and art grew over the years. You realize that the true magic
|
| 64 |
+
happens when the words on a page were paired with enchanting illustrations. """,
|
| 65 |
+
verbose=True,
|
| 66 |
+
allow_delegation=True,
|
| 67 |
+
llm = gemini_llm
|
| 68 |
+
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
artist = Agent(
|
| 73 |
role='Storybook Illustrator',
|
| 74 |
goal="""Visually bring stories to life. Create images that complement and enhance the text,
|
|
|
|
| 148 |
)
|
| 149 |
|
| 150 |
task2 = Task(
|
| 151 |
+
description="""Give each of the 8 parts a name and output the story.
|
| 152 |
+
""",
|
| 153 |
+
agent=illustrator
|
| 154 |
+
)
|
| 155 |
+
|
| 156 |
+
task3 = Task(
|
| 157 |
description="""Divide the story into 8 parts and ensure itis engaging and resonates with children, making it a valuable and enjoyable reading experience.
|
| 158 |
""",
|
| 159 |
agent=editor
|
| 160 |
)
|
| 161 |
|
| 162 |
|
| 163 |
+
task4 = Task(
|
| 164 |
description="""Summarize the author story into an image prompt.""",
|
| 165 |
agent=artist
|
| 166 |
)
|
| 167 |
|
| 168 |
+
task5 = Task(
|
| 169 |
description="""create a rhyming version of the story created by the author""",
|
| 170 |
agent=poet
|
| 171 |
)
|
| 172 |
|
| 173 |
+
task6 = Task(
|
| 174 |
description="""create a rhyming version of the story created by the author""",
|
| 175 |
agent=reader
|
| 176 |
)
|
| 177 |
|
| 178 |
+
task7 = Task(
|
| 179 |
description="""output both the story created by the author and the poem created by the poet,
|
| 180 |
make sure you label the story and the poem so you can tell them apart, name the story and poem appropriately """,
|
| 181 |
agent=finalizer
|
|
|
|
| 186 |
|
| 187 |
# Instantiate your crew with a sequential process
|
| 188 |
crew = Crew(
|
| 189 |
+
agents=[author, illustrator,
|
| 190 |
tasks=[task1, task2],
|
| 191 |
verbose=2,
|
| 192 |
process=Process.sequential
|