File size: 2,965 Bytes
dec9e8e
f63d7fd
 
 
 
57d91e6
 
 
 
 
 
 
 
 
 
 
 
f63d7fd
 
 
 
57d91e6
 
 
 
 
f63d7fd
 
 
57d91e6
 
f63d7fd
 
57d91e6
 
 
 
 
 
 
 
 
 
f63d7fd
57d91e6
f63d7fd
57d91e6
f63d7fd
44f095f
 
 
 
57d91e6
44f095f
57d91e6
 
 
 
44f095f
 
 
 
f63d7fd
57d91e6
f63d7fd
57d91e6
f63d7fd
57d91e6
f63d7fd
dec9e8e
 
f63d7fd
dec9e8e
f63d7fd
 
 
 
 
 
 
 
dec9e8e
f63d7fd
 
dec9e8e
f63d7fd
dec9e8e
f63d7fd
dec9e8e
f63d7fd
 
dec9e8e
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Home.py (Main application homepage)
import streamlit as st
import os
from dotenv import load_dotenv
import google.generativeai as genai
import sys

# Add project root to path for imports
sys.path.append(os.path.dirname(__file__))

# Apply custom styling for Huggingface Space compatibility
try:
    from .streamlit.custom import init as apply_custom_styling
    apply_custom_styling()
except (ImportError, ModuleNotFoundError):
    # Fallback for when running locally or if custom styling fails
    pass

# Load environment variables
load_dotenv()

# Initialize session state if needed
if "page_viewed" not in st.session_state:
    st.session_state.page_viewed = True

# Page setup - set this consistently across all pages
st.set_page_config(
    page_title="AI Financial Dashboard",
    page_icon="📊",
    layout="wide",
    initial_sidebar_state="expanded"
)

# Clear any previous runs to avoid stacking UI elements
if hasattr(st, 'empty'):
    placeholder = st.empty()
    with placeholder.container():
        # Application title
        st.title("📊 AI Financial Dashboard v2.0")
        
        # Display application information
        st.markdown("""
        ## Welcome to AI Financial Dashboard

        This is an intelligent financial analysis application using AI to help you make smarter investment decisions.

        ### Main Features:

        1. **📰 Daily News Report** - Summary of the latest financial news:
           - Compilation of latest financial news
           - Categorized by topic
           - Daily market updates
         
        2. **📄 Stock Analysis Report** - In-depth analysis of a specific stock:
           - Comprehensive analysis of a specific stock
           - Data collection from multiple sources
           - Generate in-depth reports with AI evaluation
         
        3. **💬 Stock Chatbot** - Chat with AI Financial Analyst: 
           - Search for stock information
           - View price charts
           - Convert currencies

        ### How to Use:

        Use the navigation bar on the left to switch between different features of the application.

        """)

# Display API connection status
st.sidebar.title("Connection Status")

# Check API keys
api_keys = {
    "GEMINI_API_KEY": os.getenv("GEMINI_API_KEY"),
    "ALPHA_VANTAGE_API_KEY": os.getenv("ALPHA_VANTAGE_API_KEY"),
    "NEWS_API_KEY": os.getenv("NEWS_API_KEY"),
    "MARKETAUX_API_KEY": os.getenv("MARKETAUX_API_KEY"),
    "TWELVEDATA_API_KEY": os.getenv("TWELVEDATA_API_KEY")
}

# Display status of each API
for api_name, api_key in api_keys.items():
    if api_key:
        st.sidebar.success(f"✅ {api_name.split('_KEY')[0].replace('_', ' ')}")
    else:
        st.sidebar.error(f"❌ {api_name.split('_KEY')[0].replace('_', ' ')}")

# Display project information
st.sidebar.markdown("---")
st.sidebar.markdown("""
### Project Information
- **Version**: 2.0
- **Update**: In-depth analysis report feature
""")