Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,9 +2,9 @@ import streamlit as st
|
|
| 2 |
import pandas as pd
|
| 3 |
import json
|
| 4 |
import os
|
| 5 |
-
from
|
| 6 |
-
from
|
| 7 |
-
from
|
| 8 |
|
| 9 |
# Define data storage paths
|
| 10 |
CSV_FILE = "user_data.csv"
|
|
@@ -35,6 +35,23 @@ def main():
|
|
| 35 |
st.title("Visionary AI by Giant Analytics")
|
| 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 |
# Collect User Information
|
| 39 |
name = st.text_input("Name")
|
| 40 |
email = st.text_input("Email")
|
|
@@ -45,73 +62,93 @@ def main():
|
|
| 45 |
input_method = st.radio("How would you like to provide company details?",
|
| 46 |
("Search by Name", "Website URL", "Manual Description", "Upload Document"))
|
| 47 |
|
| 48 |
-
company_data = ""
|
| 49 |
if input_method == "Search by Name":
|
| 50 |
if st.button("Find Company Details"):
|
| 51 |
-
company_data = search_company(company_name)
|
| 52 |
-
st.write(company_data)
|
| 53 |
elif input_method == "Website URL":
|
| 54 |
website_url = st.text_input("Enter Website URL")
|
| 55 |
if st.button("Scrape Website"):
|
| 56 |
-
company_data = scrape_website(website_url)
|
| 57 |
-
st.write(company_data)
|
| 58 |
elif input_method == "Manual Description":
|
| 59 |
-
|
| 60 |
if st.button("Process Description"):
|
| 61 |
-
company_data = process_company_description(
|
| 62 |
-
st.write(company_data)
|
| 63 |
elif input_method == "Upload Document":
|
| 64 |
uploaded_file = st.file_uploader("Upload PDF or PPT", type=["pdf", "pptx"])
|
| 65 |
if uploaded_file is not None:
|
| 66 |
-
company_data = process_uploaded_document(uploaded_file)
|
| 67 |
-
st.write(company_data)
|
| 68 |
|
| 69 |
-
if company_data:
|
|
|
|
|
|
|
|
|
|
| 70 |
industry = st.text_input("Industry Type (e.g., Healthcare, Finance)")
|
| 71 |
if st.button("Analyze Industry Trends"):
|
| 72 |
-
industry_trends = get_industry_trends(industry)
|
| 73 |
-
st.write(industry_trends)
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
if st.button("Find AI Use Cases"):
|
| 76 |
-
ai_use_cases = get_ai_use_cases(industry)
|
| 77 |
-
st.write(ai_use_cases)
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
competitor = st.text_input("Enter Competitor Name")
|
| 80 |
if st.button("Analyze Competitor AI Strategies"):
|
| 81 |
-
competitor_analysis = get_competitor_ai_strategies(competitor)
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
if st.button("Generate AI Strategy"):
|
| 85 |
-
ai_strategy = generate_ai_strategy(
|
| 86 |
-
|
|
|
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
if st.button("Suggest AI Integration Plan"):
|
| 89 |
-
ai_integration = suggest_ai_integration(
|
| 90 |
-
|
| 91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
if st.button("Identify Revenue Growth Opportunities"):
|
| 93 |
-
revenue_opportunities = identify_revenue_opportunities(
|
| 94 |
-
|
| 95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
if st.button("Generate Final Report"):
|
| 97 |
-
report_filename = generate_report(
|
|
|
|
|
|
|
| 98 |
st.success(f"Report Generated: {report_filename}")
|
| 99 |
-
|
| 100 |
# Save data to backend
|
| 101 |
user_data = {
|
| 102 |
-
"name": name,
|
| 103 |
-
"
|
| 104 |
-
"
|
| 105 |
-
"
|
| 106 |
-
"
|
| 107 |
-
"industry": industry,
|
| 108 |
-
"competitor": competitor,
|
| 109 |
-
"ai_strategy": ai_strategy,
|
| 110 |
-
"ai_integration": ai_integration,
|
| 111 |
-
"revenue_opportunities": revenue_opportunities
|
| 112 |
}
|
| 113 |
save_data_csv(user_data)
|
| 114 |
save_data_json(user_data)
|
| 115 |
|
|
|
|
|
|
|
|
|
|
| 116 |
if __name__ == "__main__":
|
| 117 |
-
main()
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import json
|
| 4 |
import os
|
| 5 |
+
from phase1_agents import search_company, scrape_website, process_company_description, process_uploaded_document
|
| 6 |
+
from phase2_agents import get_industry_trends, get_ai_use_cases, get_competitor_ai_strategies
|
| 7 |
+
from phase3_agents import generate_ai_strategy, suggest_ai_integration, identify_revenue_opportunities, generate_report
|
| 8 |
|
| 9 |
# Define data storage paths
|
| 10 |
CSV_FILE = "user_data.csv"
|
|
|
|
| 35 |
st.title("Visionary AI by Giant Analytics")
|
| 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 persistence
|
| 40 |
+
if "company_data" not in st.session_state:
|
| 41 |
+
st.session_state.company_data = ""
|
| 42 |
+
if "industry_trends" not in st.session_state:
|
| 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")
|
| 57 |
email = st.text_input("Email")
|
|
|
|
| 62 |
input_method = st.radio("How would you like to provide company details?",
|
| 63 |
("Search by Name", "Website URL", "Manual Description", "Upload Document"))
|
| 64 |
|
|
|
|
| 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")
|
| 83 |
+
st.write(st.session_state.company_data)
|
| 84 |
+
|
| 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")
|
| 91 |
+
st.write(st.session_state.industry_trends)
|
| 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")
|
| 98 |
+
st.write(st.session_state.ai_use_cases)
|
| 99 |
+
|
| 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")
|
| 106 |
+
st.write(st.session_state.competitor_analysis)
|
| 107 |
|
| 108 |
if st.button("Generate AI Strategy"):
|
| 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")
|
| 115 |
+
st.write(st.session_state.ai_strategy)
|
| 116 |
+
|
| 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")
|
| 123 |
+
st.write(st.session_state.ai_integration)
|
| 124 |
+
|
| 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")
|
| 131 |
+
st.write(st.session_state.revenue_opportunities)
|
| 132 |
+
|
| 133 |
if st.button("Generate Final Report"):
|
| 134 |
+
report_filename = generate_report(
|
| 135 |
+
company_name, st.session_state.ai_strategy, st.session_state.ai_integration,
|
| 136 |
+
st.session_state.revenue_opportunities)
|
| 137 |
st.success(f"Report Generated: {report_filename}")
|
| 138 |
+
|
| 139 |
# Save data to backend
|
| 140 |
user_data = {
|
| 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()
|