File size: 1,238 Bytes
7aba694
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
from 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.set_page_config(
        page_title="Financial Analyst Bot",
        layout="wide",
        menu_items={
            'Get Help': 'https://www.infosys.com/investors.html',
            'Report a bug': None,
            'About': "Infosys Financial Analyst v1.0"
        }
    )

    st.title("💰 INFY Financial Analyst (2022-2024)")
    st.markdown("Ask questions about Infosys financial statements from 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()