Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -123,14 +123,12 @@ with gr.Blocks(css=CSS, theme=gr.themes.Base()) as app:
|
|
| 123 |
plan = research_and_plan(config, planner_model, tavily_client, topic_state, user_input)
|
| 124 |
report_generator = write_report_stream(config, writer_model, tavily_client, embedding_model, reranker, plan)
|
| 125 |
|
| 126 |
-
|
| 127 |
for update in report_generator:
|
| 128 |
-
|
| 129 |
-
history[-1] = (user_input,
|
| 130 |
yield history, "GENERATING", topic_state, gr.update(interactive=False)
|
| 131 |
|
| 132 |
-
full_report = status_updates # The final state of the stream is the report
|
| 133 |
-
history.append((None, full_report))
|
| 134 |
yield history, "INITIAL", "", gr.update(interactive=True, placeholder="Research complete. What's the next topic?")
|
| 135 |
|
| 136 |
except Exception as e:
|
|
|
|
| 123 |
plan = research_and_plan(config, planner_model, tavily_client, topic_state, user_input)
|
| 124 |
report_generator = write_report_stream(config, writer_model, tavily_client, embedding_model, reranker, plan)
|
| 125 |
|
| 126 |
+
stream_content = ""
|
| 127 |
for update in report_generator:
|
| 128 |
+
stream_content = update
|
| 129 |
+
history[-1] = (user_input, stream_content)
|
| 130 |
yield history, "GENERATING", topic_state, gr.update(interactive=False)
|
| 131 |
|
|
|
|
|
|
|
| 132 |
yield history, "INITIAL", "", gr.update(interactive=True, placeholder="Research complete. What's the next topic?")
|
| 133 |
|
| 134 |
except Exception as e:
|