ghengx commited on
Commit
6545f50
·
1 Parent(s): 0fb34fb
Files changed (2) hide show
  1. app.py +16 -0
  2. requirements.txt +3 -0
app.py CHANGED
@@ -30,6 +30,9 @@ if "auth" not in st.session_state:
30
  if "chart" not in st.session_state:
31
  st.session_state.chart = None
32
 
 
 
 
33
  if st.session_state.auth:
34
  for message in st.session_state.messages:
35
  with st.chat_message(message["role"]):
@@ -52,6 +55,19 @@ if st.session_state.auth:
52
  st.chat_message("assistant").plotly_chart(
53
  st.session_state.chart
54
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  st.session_state.messages.append({"role": "assistant", "content": typed_response})
57
  else:
 
30
  if "chart" not in st.session_state:
31
  st.session_state.chart = None
32
 
33
+ if "report" not in st.session_state:
34
+ st.session_state.report = None
35
+
36
  if st.session_state.auth:
37
  for message in st.session_state.messages:
38
  with st.chat_message(message["role"]):
 
55
  st.chat_message("assistant").plotly_chart(
56
  st.session_state.chart
57
  )
58
+ st.session_state.chart = None
59
+
60
+ if st.session_state.report:
61
+ def onclick():
62
+ st.session_state.report = None
63
+ st.chat_message("assistant").download_button(
64
+ label=f"{st.session_state.report}",
65
+ data=st.session_state.report_df,
66
+ file_name=f"{st.session_state.report}_report.csv",
67
+ mime="text/csv",
68
+ on_click=onclick()
69
+ )
70
+
71
 
72
  st.session_state.messages.append({"role": "assistant", "content": typed_response})
73
  else:
requirements.txt CHANGED
@@ -7,8 +7,10 @@ cachetools==5.5.1
7
  certifi==2025.1.31
8
  charset-normalizer==3.4.1
9
  click==8.1.8
 
10
  distro==1.9.0
11
  filelock==3.17.0
 
12
  fsspec==2025.2.0
13
  gitdb==4.0.12
14
  GitPython==3.1.44
@@ -46,6 +48,7 @@ referencing==0.36.2
46
  requests==2.32.3
47
  rich==13.9.4
48
  rpds-py==0.22.3
 
49
  six==1.17.0
50
  smmap==5.0.2
51
  sniffio==1.3.1
 
7
  certifi==2025.1.31
8
  charset-normalizer==3.4.1
9
  click==8.1.8
10
+ CurrencyConverter==0.18.2
11
  distro==1.9.0
12
  filelock==3.17.0
13
+ forex-python==1.8
14
  fsspec==2025.2.0
15
  gitdb==4.0.12
16
  GitPython==3.1.44
 
48
  requests==2.32.3
49
  rich==13.9.4
50
  rpds-py==0.22.3
51
+ simplejson==3.19.3
52
  six==1.17.0
53
  smmap==5.0.2
54
  sniffio==1.3.1