MusaR commited on
Commit
696ad4d
·
verified ·
1 Parent(s): 6c7e46e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
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
- status_updates = ""
127
  for update in report_generator:
128
- status_updates += update
129
- history[-1] = (user_input, status_updates)
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: