decodingdatascience commited on
Commit
bc24811
1 Parent(s): 51d68fa

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +54 -0
  2. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import google.generativeai as genai
3
+ import os
4
+ from dotenv import load_dotenv
5
+ load_dotenv()
6
+
7
+ # Configure the API using the key from environment variables
8
+ genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
9
+
10
+ # Function to get response from the Gemini model
11
+ def get_gemini_response(input_text):
12
+ model = genai.GenerativeModel('gemini-pro')
13
+ response = model.generate_content(input_text)
14
+ return response.text
15
+
16
+ # Streamlit UI setup
17
+ st.title("Equity Research AI BOT")
18
+ st.subheader("The Power of LLM for Stock Analysis")
19
+ company_name = st.text_input("Enter the Name of the Company")
20
+
21
+ submit = st.button('Do Equity Research')
22
+ if submit and company_name:
23
+ # Prepare the input prompt using the company name
24
+ input_prompt = f"""
25
+ As an advanced Equity Research Bot with a deep understanding of finance, economics, and market analysis, your role is to conduct comprehensive equity research like a skilled research analyst.
26
+
27
+ Your evaluation will involve analyzing various financial data, company earnings reports, market trends, and economic indicators to provide insightful equity research. Utilize sophisticated financial models, ratios, and analytical techniques to assess the value and potential of stocks.
28
+
29
+
30
+ Provide a detailed analysis report on the equity in question, highlighting financial health, growth prospects, market position, and any potential risks or opportunities. Your analysis should include an assessment of the company's revenue, profit margins, debt levels, and competitive advantages.
31
+
32
+ Offer a well-founded investment recommendation based on your analysis, categorizing the equity as a Buy, Hold, or Sell. Your recommendation should be supported by a clear rationale, incorporating quantitative and qualitative findings from your research.
33
+
34
+ Your evaluation should be meticulous, data-driven, and impartial, ensuring that investors receive accurate and actionable insights to inform their investment decisions.
35
+
36
+ Remember to leverage your expertise in finance and market analysis to deliver a high-quality equity research report that aids in making informed investment choices. Your detailed analysis and recommendations will be pivotal in guiding investment strategies and portfolio decisions.
37
+ Equity Analysis Input:
38
+ Company Name: {company_name}
39
+ Analysis Output:
40
+ Country for the Current Head quarters of {company_name}
41
+ founding year of {company_name}
42
+ name of stock exchange market {company_name} listed on
43
+ name of stock indices {company_name} listed on
44
+ List of Industries, the {company_name} operates in
45
+ Provide a detailed financial analysis of the equity, including key metrics and ratios.
46
+ Assess the company's market position, growth prospects, and potential risks.
47
+ Offer a clear investment recommendation (Buy, Hold, Sell) with a rationale based on your analysis.
48
+ Add a disclaimer below of the repsonse
49
+
50
+ """
51
+ response = get_gemini_response(input_prompt)
52
+ st.write(response)
53
+ elif submit and not company_name:
54
+ st.error("Please enter the name of the company to proceed.")
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ streamlit
2
+ google-generativeai
3
+ python-dotenv