QuantumLearner commited on
Commit
6d546db
·
verified ·
1 Parent(s): 6eb7b3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
app.py CHANGED
@@ -35,7 +35,7 @@ async def get_report(query: str, report_type: str, sources: list, report_source:
35
 
36
  while True:
37
  logs = f.getvalue()
38
- logs_container.text_area("Agent Logs", logs, height=200, key="realtime_logs_display")
39
  await asyncio.sleep(1) # Update every second
40
  if "Finalized research step" in logs:
41
  break
@@ -112,18 +112,17 @@ st.markdown(
112
 
113
  st.markdown('<p class="big-green-font">Enter your research query:</p>', unsafe_allow_html=True)
114
 
 
 
 
115
  # Display the input field for the user
116
- user_query = st.text_input("", "Why is the Stock Price of Nvidia Soaring?", help="Type your research question or topic.")
117
 
118
  # Process the query to include the current date after the user inputs their query
119
  if user_query:
120
  current_date = datetime.now().strftime("%B %Y")
121
  final_query = f"{user_query} Current Date is {current_date}"
122
 
123
- # Use final_query for further processing without displaying it
124
- # Example: st.write("Processing your query...")
125
- # The processed final_query will be used downstream in the application.
126
-
127
  st.sidebar.title("Research Settings")
128
 
129
  with st.sidebar.expander("How to Use", expanded=False):
@@ -137,7 +136,6 @@ with st.sidebar.expander("How to Use", expanded=False):
137
  """)
138
 
139
  with st.sidebar:
140
- #st.markdown("### Research Settings")
141
  research_type = st.selectbox("Select research type:", ["Web Research", "Document Research"], help="Choose between web-based research or research from local documents.")
142
  report_type = st.selectbox("Select report type:", ["research_report", "resource_list", "article_outline"], help="Choose the format of the final report.")
143
 
@@ -189,9 +187,14 @@ if 'report' in st.session_state:
189
 
190
  st.markdown("### Agent Logs")
191
  if 'logs' in st.session_state:
192
- st.text_area("Logs will appear here during the research process.", st.session_state.logs, height=200,key="final_logs_display")
 
 
 
193
  else:
194
- st.text_area("Logs will appear here during the research process.", height=200, key="final_logs_display")
 
 
195
 
196
  # Hide Streamlit's default footer and menu
197
  hide_streamlit_style = """
 
35
 
36
  while True:
37
  logs = f.getvalue()
38
+ logs_container.text_area("Agent Logs", logs, height=200, key="realtime_logs_display_unique")
39
  await asyncio.sleep(1) # Update every second
40
  if "Finalized research step" in logs:
41
  break
 
112
 
113
  st.markdown('<p class="big-green-font">Enter your research query:</p>', unsafe_allow_html=True)
114
 
115
+ # Default query with current context
116
+ default_query = "Why is the Stock Price of Nvidia Soaring?"
117
+
118
  # Display the input field for the user
119
+ user_query = st.text_input("", default_query, help="Type your research question or topic.")
120
 
121
  # Process the query to include the current date after the user inputs their query
122
  if user_query:
123
  current_date = datetime.now().strftime("%B %Y")
124
  final_query = f"{user_query} Current Date is {current_date}"
125
 
 
 
 
 
126
  st.sidebar.title("Research Settings")
127
 
128
  with st.sidebar.expander("How to Use", expanded=False):
 
136
  """)
137
 
138
  with st.sidebar:
 
139
  research_type = st.selectbox("Select research type:", ["Web Research", "Document Research"], help="Choose between web-based research or research from local documents.")
140
  report_type = st.selectbox("Select report type:", ["research_report", "resource_list", "article_outline"], help="Choose the format of the final report.")
141
 
 
187
 
188
  st.markdown("### Agent Logs")
189
  if 'logs' in st.session_state:
190
+ st.text_area("Logs will appear here during the research process.",
191
+ st.session_state.logs,
192
+ height=200,
193
+ key="final_logs_display_unique")
194
  else:
195
+ st.text_area("Logs will appear here during the research process.",
196
+ height=200,
197
+ key="final_logs_display_alternative")
198
 
199
  # Hide Streamlit's default footer and menu
200
  hide_streamlit_style = """