Upload folder using huggingface_hub
Browse files- streamlit_app.py +17 -1
streamlit_app.py
CHANGED
|
@@ -47,7 +47,7 @@ def send_discord_notification(symbol, price, change_percent, prediction_dir):
|
|
| 47 |
pred_emoji = "π’" if "UP" in prediction_dir else "π΄"
|
| 48 |
|
| 49 |
# Format the message string
|
| 50 |
-
message = (f"**
|
| 51 |
f"**{symbol}**: ${price:.2f} {emoji} ({change_percent:.2f}%)\n"
|
| 52 |
f"**AI Prediction:** {prediction_dir} {pred_emoji}")
|
| 53 |
|
|
@@ -141,6 +141,22 @@ if st.sidebar.button("π Refresh Data"):
|
|
| 141 |
st.cache_data.clear() # Clear cache to force update
|
| 142 |
st.rerun()
|
| 143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
# --- Main Logic ---
|
| 145 |
|
| 146 |
# 1. Fetch Data
|
|
|
|
| 47 |
pred_emoji = "π’" if "UP" in prediction_dir else "π΄"
|
| 48 |
|
| 49 |
# Format the message string
|
| 50 |
+
message = (f"**Stock Update** π\n"
|
| 51 |
f"**{symbol}**: ${price:.2f} {emoji} ({change_percent:.2f}%)\n"
|
| 52 |
f"**AI Prediction:** {prediction_dir} {pred_emoji}")
|
| 53 |
|
|
|
|
| 141 |
st.cache_data.clear() # Clear cache to force update
|
| 142 |
st.rerun()
|
| 143 |
|
| 144 |
+
# --- Debugging Status (Sidebar) ---
|
| 145 |
+
st.sidebar.markdown("---")
|
| 146 |
+
st.sidebar.subheader("π οΈ System Status")
|
| 147 |
+
|
| 148 |
+
# Check Webhook
|
| 149 |
+
if WEBHOOK_URL:
|
| 150 |
+
st.sidebar.success(f"Discord Webhook: Configured (Ends in ...{WEBHOOK_URL[-4:]})")
|
| 151 |
+
else:
|
| 152 |
+
st.sidebar.error("Discord Webhook: Missing β")
|
| 153 |
+
|
| 154 |
+
# Check Alpha Vantage
|
| 155 |
+
if ALPHA_VANTAGE_KEY:
|
| 156 |
+
st.sidebar.success("Alpha Vantage: Configured β
")
|
| 157 |
+
else:
|
| 158 |
+
st.sidebar.warning("Alpha Vantage: Missing β οΈ (Using Mock Data)")
|
| 159 |
+
|
| 160 |
# --- Main Logic ---
|
| 161 |
|
| 162 |
# 1. Fetch Data
|