Spaces:
Sleeping
Sleeping
update gradio UI
Browse files
app.py
CHANGED
|
@@ -151,25 +151,23 @@ def fetch_context(topic):
|
|
| 151 |
return summary
|
| 152 |
|
| 153 |
# Define Gradio Handler
|
| 154 |
-
import time
|
| 155 |
-
from datetime import datetime
|
| 156 |
def generate_blog(topic, tone, progress=gr.Progress(track_tqdm=True)):
|
| 157 |
progress(0, desc="Starting collaborative report generation...")
|
| 158 |
yield "### 🧭 Starting Collaborative Report\n"
|
| 159 |
|
| 160 |
-
# Run the entire
|
| 161 |
-
|
| 162 |
|
| 163 |
-
#
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
|
| 171 |
-
progress(1.0, desc="
|
| 172 |
-
yield "✅ **
|
| 173 |
|
| 174 |
# Build Gradio Interface
|
| 175 |
css = """
|
|
|
|
| 151 |
return summary
|
| 152 |
|
| 153 |
# Define Gradio Handler
|
|
|
|
|
|
|
| 154 |
def generate_blog(topic, tone, progress=gr.Progress(track_tqdm=True)):
|
| 155 |
progress(0, desc="Starting collaborative report generation...")
|
| 156 |
yield "### 🧭 Starting Collaborative Report\n"
|
| 157 |
|
| 158 |
+
# Run the entire multi-agent workflow once (non-streaming)
|
| 159 |
+
result = crew.kickoff(inputs={"topic": topic, "tone": tone})
|
| 160 |
|
| 161 |
+
# Try to extract clean text output
|
| 162 |
+
if hasattr(result, "output"):
|
| 163 |
+
final_output = result.output
|
| 164 |
+
elif hasattr(result, "final_output"):
|
| 165 |
+
final_output = result.final_output
|
| 166 |
+
else:
|
| 167 |
+
final_output = str(result)
|
| 168 |
|
| 169 |
+
progress(1.0, desc="Completed.")
|
| 170 |
+
yield f"✅ **Collaborative Report Generated Successfully!**\n\n{final_output}"
|
| 171 |
|
| 172 |
# Build Gradio Interface
|
| 173 |
css = """
|