Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,21 +36,10 @@ def main():
|
|
| 36 |
st.write("Fill in the details to generate an AI-driven business strategy report.")
|
| 37 |
st.write("It uses SOTA (State-of-the-Art) Reasoning Models to provide cutting-edge insights and AI integration strategies.")
|
| 38 |
|
| 39 |
-
# Initialize session state for data
|
| 40 |
-
|
| 41 |
-
st.session_state
|
| 42 |
-
|
| 43 |
-
st.session_state.industry_trends = ""
|
| 44 |
-
if "ai_use_cases" not in st.session_state:
|
| 45 |
-
st.session_state.ai_use_cases = ""
|
| 46 |
-
if "competitor_analysis" not in st.session_state:
|
| 47 |
-
st.session_state.competitor_analysis = ""
|
| 48 |
-
if "ai_strategy" not in st.session_state:
|
| 49 |
-
st.session_state.ai_strategy = ""
|
| 50 |
-
if "ai_integration" not in st.session_state:
|
| 51 |
-
st.session_state.ai_integration = ""
|
| 52 |
-
if "revenue_opportunities" not in st.session_state:
|
| 53 |
-
st.session_state.revenue_opportunities = ""
|
| 54 |
|
| 55 |
# Collect User Information
|
| 56 |
name = st.text_input("Name")
|
|
@@ -65,18 +54,22 @@ def main():
|
|
| 65 |
if input_method == "Search by Name":
|
| 66 |
if st.button("Find Company Details"):
|
| 67 |
st.session_state.company_data = search_company(company_name)
|
|
|
|
| 68 |
elif input_method == "Website URL":
|
| 69 |
website_url = st.text_input("Enter Website URL")
|
| 70 |
if st.button("Scrape Website"):
|
| 71 |
st.session_state.company_data = scrape_website(website_url)
|
|
|
|
| 72 |
elif input_method == "Manual Description":
|
| 73 |
company_data_input = st.text_area("Enter Company Description")
|
| 74 |
if st.button("Process Description"):
|
| 75 |
st.session_state.company_data = process_company_description(company_data_input)
|
|
|
|
| 76 |
elif input_method == "Upload Document":
|
| 77 |
uploaded_file = st.file_uploader("Upload PDF or PPT", type=["pdf", "pptx"])
|
| 78 |
if uploaded_file is not None:
|
| 79 |
st.session_state.company_data = process_uploaded_document(uploaded_file)
|
|
|
|
| 80 |
|
| 81 |
if st.session_state.company_data:
|
| 82 |
st.subheader("Extracted Company Information")
|
|
@@ -85,6 +78,7 @@ def main():
|
|
| 85 |
industry = st.text_input("Industry Type (e.g., Healthcare, Finance)")
|
| 86 |
if st.button("Analyze Industry Trends"):
|
| 87 |
st.session_state.industry_trends = get_industry_trends(industry)
|
|
|
|
| 88 |
|
| 89 |
if st.session_state.industry_trends:
|
| 90 |
st.subheader("Industry Trends")
|
|
@@ -92,6 +86,7 @@ def main():
|
|
| 92 |
|
| 93 |
if st.button("Find AI Use Cases"):
|
| 94 |
st.session_state.ai_use_cases = get_ai_use_cases(industry)
|
|
|
|
| 95 |
|
| 96 |
if st.session_state.ai_use_cases:
|
| 97 |
st.subheader("AI Use Cases")
|
|
@@ -100,6 +95,7 @@ def main():
|
|
| 100 |
competitor = st.text_input("Enter Competitor Name")
|
| 101 |
if st.button("Analyze Competitor AI Strategies"):
|
| 102 |
st.session_state.competitor_analysis = get_competitor_ai_strategies(competitor)
|
|
|
|
| 103 |
|
| 104 |
if st.session_state.competitor_analysis:
|
| 105 |
st.subheader("Competitor AI Strategies")
|
|
@@ -109,6 +105,7 @@ def main():
|
|
| 109 |
st.session_state.ai_strategy = generate_ai_strategy(
|
| 110 |
st.session_state.company_data, st.session_state.industry_trends,
|
| 111 |
st.session_state.ai_use_cases, st.session_state.competitor_analysis)
|
|
|
|
| 112 |
|
| 113 |
if st.session_state.ai_strategy:
|
| 114 |
st.subheader("AI Strategy")
|
|
@@ -117,6 +114,7 @@ def main():
|
|
| 117 |
if st.button("Suggest AI Integration Plan"):
|
| 118 |
st.session_state.ai_integration = suggest_ai_integration(
|
| 119 |
st.session_state.company_data, st.session_state.ai_strategy)
|
|
|
|
| 120 |
|
| 121 |
if st.session_state.ai_integration:
|
| 122 |
st.subheader("AI Integration Plan")
|
|
@@ -125,6 +123,7 @@ def main():
|
|
| 125 |
if st.button("Identify Revenue Growth Opportunities"):
|
| 126 |
st.session_state.revenue_opportunities = identify_revenue_opportunities(
|
| 127 |
st.session_state.company_data, st.session_state.ai_strategy)
|
|
|
|
| 128 |
|
| 129 |
if st.session_state.revenue_opportunities:
|
| 130 |
st.subheader("Revenue Growth Opportunities")
|
|
@@ -136,19 +135,8 @@ def main():
|
|
| 136 |
st.session_state.revenue_opportunities)
|
| 137 |
st.success(f"Report Generated: {report_filename}")
|
| 138 |
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
"name": name, "email": email, "mobile": mobile, "company_name": company_name,
|
| 142 |
-
"company_data": st.session_state.company_data, "industry": industry,
|
| 143 |
-
"competitor": competitor, "ai_strategy": st.session_state.ai_strategy,
|
| 144 |
-
"ai_integration": st.session_state.ai_integration,
|
| 145 |
-
"revenue_opportunities": st.session_state.revenue_opportunities
|
| 146 |
-
}
|
| 147 |
-
save_data_csv(user_data)
|
| 148 |
-
save_data_json(user_data)
|
| 149 |
-
|
| 150 |
-
st.markdown("---")
|
| 151 |
-
st.markdown("**Developed by [Aditya Ghadge](https://www.linkedin.com/in/aditya-ghadge-a82b30240/) for Giant Analytics**")
|
| 152 |
|
| 153 |
if __name__ == "__main__":
|
| 154 |
-
main()
|
|
|
|
| 36 |
st.write("Fill in the details to generate an AI-driven business strategy report.")
|
| 37 |
st.write("It uses SOTA (State-of-the-Art) Reasoning Models to provide cutting-edge insights and AI integration strategies.")
|
| 38 |
|
| 39 |
+
# Initialize session state for persistent data
|
| 40 |
+
for key in ["company_data", "industry_trends", "ai_use_cases", "competitor_analysis", "ai_strategy", "ai_integration", "revenue_opportunities"]:
|
| 41 |
+
if key not in st.session_state:
|
| 42 |
+
st.session_state[key] = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
# Collect User Information
|
| 45 |
name = st.text_input("Name")
|
|
|
|
| 54 |
if input_method == "Search by Name":
|
| 55 |
if st.button("Find Company Details"):
|
| 56 |
st.session_state.company_data = search_company(company_name)
|
| 57 |
+
st.experimental_rerun()
|
| 58 |
elif input_method == "Website URL":
|
| 59 |
website_url = st.text_input("Enter Website URL")
|
| 60 |
if st.button("Scrape Website"):
|
| 61 |
st.session_state.company_data = scrape_website(website_url)
|
| 62 |
+
st.experimental_rerun()
|
| 63 |
elif input_method == "Manual Description":
|
| 64 |
company_data_input = st.text_area("Enter Company Description")
|
| 65 |
if st.button("Process Description"):
|
| 66 |
st.session_state.company_data = process_company_description(company_data_input)
|
| 67 |
+
st.experimental_rerun()
|
| 68 |
elif input_method == "Upload Document":
|
| 69 |
uploaded_file = st.file_uploader("Upload PDF or PPT", type=["pdf", "pptx"])
|
| 70 |
if uploaded_file is not None:
|
| 71 |
st.session_state.company_data = process_uploaded_document(uploaded_file)
|
| 72 |
+
st.experimental_rerun()
|
| 73 |
|
| 74 |
if st.session_state.company_data:
|
| 75 |
st.subheader("Extracted Company Information")
|
|
|
|
| 78 |
industry = st.text_input("Industry Type (e.g., Healthcare, Finance)")
|
| 79 |
if st.button("Analyze Industry Trends"):
|
| 80 |
st.session_state.industry_trends = get_industry_trends(industry)
|
| 81 |
+
st.experimental_rerun()
|
| 82 |
|
| 83 |
if st.session_state.industry_trends:
|
| 84 |
st.subheader("Industry Trends")
|
|
|
|
| 86 |
|
| 87 |
if st.button("Find AI Use Cases"):
|
| 88 |
st.session_state.ai_use_cases = get_ai_use_cases(industry)
|
| 89 |
+
st.experimental_rerun()
|
| 90 |
|
| 91 |
if st.session_state.ai_use_cases:
|
| 92 |
st.subheader("AI Use Cases")
|
|
|
|
| 95 |
competitor = st.text_input("Enter Competitor Name")
|
| 96 |
if st.button("Analyze Competitor AI Strategies"):
|
| 97 |
st.session_state.competitor_analysis = get_competitor_ai_strategies(competitor)
|
| 98 |
+
st.experimental_rerun()
|
| 99 |
|
| 100 |
if st.session_state.competitor_analysis:
|
| 101 |
st.subheader("Competitor AI Strategies")
|
|
|
|
| 105 |
st.session_state.ai_strategy = generate_ai_strategy(
|
| 106 |
st.session_state.company_data, st.session_state.industry_trends,
|
| 107 |
st.session_state.ai_use_cases, st.session_state.competitor_analysis)
|
| 108 |
+
st.experimental_rerun()
|
| 109 |
|
| 110 |
if st.session_state.ai_strategy:
|
| 111 |
st.subheader("AI Strategy")
|
|
|
|
| 114 |
if st.button("Suggest AI Integration Plan"):
|
| 115 |
st.session_state.ai_integration = suggest_ai_integration(
|
| 116 |
st.session_state.company_data, st.session_state.ai_strategy)
|
| 117 |
+
st.experimental_rerun()
|
| 118 |
|
| 119 |
if st.session_state.ai_integration:
|
| 120 |
st.subheader("AI Integration Plan")
|
|
|
|
| 123 |
if st.button("Identify Revenue Growth Opportunities"):
|
| 124 |
st.session_state.revenue_opportunities = identify_revenue_opportunities(
|
| 125 |
st.session_state.company_data, st.session_state.ai_strategy)
|
| 126 |
+
st.experimental_rerun()
|
| 127 |
|
| 128 |
if st.session_state.revenue_opportunities:
|
| 129 |
st.subheader("Revenue Growth Opportunities")
|
|
|
|
| 135 |
st.session_state.revenue_opportunities)
|
| 136 |
st.success(f"Report Generated: {report_filename}")
|
| 137 |
|
| 138 |
+
st.markdown("---")
|
| 139 |
+
st.markdown("**Developed by Aditya Ghadge for Giant Analytics**")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
if __name__ == "__main__":
|
| 142 |
+
main()
|