Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -95,23 +95,23 @@ if generate_blog:
|
|
95 |
agent=blog_writer
|
96 |
)
|
97 |
|
98 |
-
# Create crew
|
99 |
crew = Crew(
|
100 |
agents=[blog_researcher, blog_writer],
|
101 |
tasks=[research_task, write_task],
|
102 |
process=Process.sequential,
|
103 |
-
verbose=2
|
104 |
)
|
105 |
|
106 |
try:
|
107 |
-
# Kickoff the process
|
108 |
-
result = crew.kickoff()
|
109 |
|
110 |
# Extract blog content from the result
|
111 |
-
if hasattr(result, '
|
112 |
-
blog_content = result.
|
113 |
else:
|
114 |
-
# If
|
115 |
blog_content = str(result)
|
116 |
|
117 |
# Display the blog content
|
|
|
95 |
agent=blog_writer
|
96 |
)
|
97 |
|
98 |
+
# Create crew - Fixed verbose parameter to be boolean
|
99 |
crew = Crew(
|
100 |
agents=[blog_researcher, blog_writer],
|
101 |
tasks=[research_task, write_task],
|
102 |
process=Process.sequential,
|
103 |
+
verbose=True # Changed from 2 to True
|
104 |
)
|
105 |
|
106 |
try:
|
107 |
+
# Kickoff the process with the news link as input
|
108 |
+
result = crew.kickoff(inputs={'topic': news_link})
|
109 |
|
110 |
# Extract blog content from the result
|
111 |
+
if hasattr(result, 'tasks_output'):
|
112 |
+
blog_content = result.tasks_output[-1].raw # Get the last task's output
|
113 |
else:
|
114 |
+
# If tasks_output is not available, try to get the raw result
|
115 |
blog_content = str(result)
|
116 |
|
117 |
# Display the blog content
|