Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,12 @@ agent = Agent(
|
|
| 28 |
)
|
| 29 |
|
| 30 |
def generate_article(topic):
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
iface = gr.Interface(
|
| 34 |
fn=generate_article,
|
|
|
|
| 28 |
)
|
| 29 |
|
| 30 |
def generate_article(topic):
|
| 31 |
+
response = agent.print_response(topic, stream=True)
|
| 32 |
+
# Collect the streamed responses
|
| 33 |
+
full_response = ""
|
| 34 |
+
for part in response:
|
| 35 |
+
full_response += part
|
| 36 |
+
return full_response
|
| 37 |
|
| 38 |
iface = gr.Interface(
|
| 39 |
fn=generate_article,
|