File size: 1,027 Bytes
08e72ce
 
 
af84697
7aba694
5e632d0
7aba694
 
 
 
 
 
 
 
 
 
a86fd2f
 
7aba694
 
08e72ce
7aba694
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4380a9e
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
# app.py

import sys
sys.path.append('/home/user/app')
import streamlit as st
from app_utils import generate_answer

# Streamlit configuration
st.set_page_config(
    page_title="Financial Analyst Bot",
    layout="wide",
    menu_items={
        'Get Help': 'https://www.infosys.com/investors.html',
        'About': "Infosys Financial Analyst v1.0"
    }
)
        

def main():
    st.title("💰 INFY Financial Analyst (2022-2024)")
    st.markdown("Ask questions about Infosys financial statements from the last 2 years.")

    query = st.text_input("Enter your question:")

    if st.button("Submit"):
        if query:
            with st.spinner("Analyzing financial reports..."):
                response, confidence = generate_answer(query)

            st.subheader("Answer:")
            st.markdown(f"```{response}```")

            st.subheader("Confidence Score:")
            st.progress(confidence)
            st.markdown(f"{confidence * 100:.1f}% relevance confidence")

if __name__ == "__main__":
    main()