eagle0504 commited on
Commit
2a2cb1e
1 Parent(s): 6e35090

qa bot set in the sidebar

Browse files
Files changed (1) hide show
  1. utils/ui_helper.py +12 -15
utils/ui_helper.py CHANGED
@@ -47,6 +47,18 @@ def main_algo_trader():
47
  # Process inputs
48
  tickers_list = [ticker.strip() for ticker in tickers.split(",")]
49
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  # Run analysis on button click
51
  if st.button("Run Analysis"):
52
  with st.spinner("Downloading data and calculating returns..."):
@@ -185,21 +197,6 @@ def main_algo_trader():
185
  mime="text/csv",
186
  )
187
 
188
- # Question-answering
189
- user_question = st.text_input(
190
- "Enter your question:",
191
- f"Give me some basic descriptions of the public companies with the following ticker(s): {recent_selected_stocks}.",
192
- )
193
- if csv:
194
- st.write(f"Question entered: {user_question}")
195
- with st.spinner("Running langchain agent with GPT3..."):
196
- final_ans = run_langchain_agent_(
197
- question=str(user_question)
198
- )
199
- st.markdown(final_ans)
200
- else:
201
- st.write("We have not ran the momentum strategy yet!")
202
-
203
 
204
  # chinese
205
  def main_algo_trader_chinese():
 
47
  # Process inputs
48
  tickers_list = [ticker.strip() for ticker in tickers.split(",")]
49
 
50
+ # Question-answering
51
+ user_question = st.sidebar.text_input(
52
+ "Enter your question:",
53
+ f"Tell me about Microsoft as a financial advisor",
54
+ )
55
+ with st.sidebar:
56
+ with st.spinner("Running langchain agent with GPT3..."):
57
+ final_ans = run_langchain_agent_(
58
+ question=str(user_question)
59
+ )
60
+ st.markdown(final_ans)
61
+
62
  # Run analysis on button click
63
  if st.button("Run Analysis"):
64
  with st.spinner("Downloading data and calculating returns..."):
 
197
  mime="text/csv",
198
  )
199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
 
201
  # chinese
202
  def main_algo_trader_chinese():