Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -138,28 +138,30 @@ with col2:
|
|
| 138 |
user_query = st.text_input("π¬ What financial insights are you looking for?")
|
| 139 |
|
| 140 |
st.markdown("---")
|
|
|
|
|
|
|
| 141 |
if mode == "π PDF Upload Mode":
|
| 142 |
st.markdown("### π Upload Your Financial Report")
|
| 143 |
-
uploaded_file = st.file_uploader("πΌ Upload PDF
|
| 144 |
-
|
| 145 |
-
ai_ticker = None
|
| 146 |
else:
|
| 147 |
st.markdown("### π Live Market Data")
|
| 148 |
-
|
| 149 |
uploaded_file = None
|
| 150 |
-
pdf_ticker = None
|
| 151 |
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
|
|
|
| 157 |
else:
|
| 158 |
-
with st.spinner("π Your Query is Processing, this can take
|
| 159 |
-
response = generate_response(user_query,
|
| 160 |
st.markdown("---")
|
| 161 |
st.markdown("<h3 style='color: #4CAF50;'>π‘ AI Response</h3>", unsafe_allow_html=True)
|
| 162 |
st.write(response)
|
| 163 |
|
|
|
|
| 164 |
st.markdown("---")
|
| 165 |
|
|
|
|
| 138 |
user_query = st.text_input("π¬ What financial insights are you looking for?")
|
| 139 |
|
| 140 |
st.markdown("---")
|
| 141 |
+
uploaded_file, company_ticker = None, None
|
| 142 |
+
|
| 143 |
if mode == "π PDF Upload Mode":
|
| 144 |
st.markdown("### π Upload Your Financial Report")
|
| 145 |
+
uploaded_file = st.file_uploader("πΌ Upload PDF Report", type=["pdf"])
|
| 146 |
+
|
|
|
|
| 147 |
else:
|
| 148 |
st.markdown("### π Live Market Data")
|
| 149 |
+
company_ticker = st.text_input("π’ Enter Company Ticker Symbol", placeholder="e.g., AAPL, MSFT")
|
| 150 |
uploaded_file = None
|
|
|
|
| 151 |
|
| 152 |
+
# π― Submit Button
|
| 153 |
+
if st.button("π Analyze Now"):
|
| 154 |
+
if mode == "π PDF Upload Mode" and not uploaded_file:
|
| 155 |
+
st.error("β Please upload a PDF file.")
|
| 156 |
+
elif mode == "π Live Data Mode" and not company_ticker:
|
| 157 |
+
st.error("β Please enter a valid company ticker symbol.")
|
| 158 |
else:
|
| 159 |
+
with st.spinner("π Your Query is Processing, this can take upto 5 - 7 minutesβ³"):
|
| 160 |
+
response = generate_response(user_query, company_ticker, mode, uploaded_file)
|
| 161 |
st.markdown("---")
|
| 162 |
st.markdown("<h3 style='color: #4CAF50;'>π‘ AI Response</h3>", unsafe_allow_html=True)
|
| 163 |
st.write(response)
|
| 164 |
|
| 165 |
+
# π Footer
|
| 166 |
st.markdown("---")
|
| 167 |
|