-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick_demo.py
More file actions
153 lines (128 loc) Β· 5.35 KB
/
Copy pathquick_demo.py
File metadata and controls
153 lines (128 loc) Β· 5.35 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/usr/bin/env python3
"""
Quick web demo for judges - shows Google AI in action
"""
import streamlit as st
import google.generativeai as genai
import os
from dotenv import load_dotenv
import time
# Load environment variables
load_dotenv()
# Configure page
st.set_page_config(
page_title="Startup Analyst - Google AI Demo",
page_icon="π",
layout="wide"
)
# Configure Google AI
@st.cache_resource
def setup_google_ai():
api_key = os.getenv("GOOGLE_API_KEY")
if not api_key:
st.error("Google API key not found. Please set GOOGLE_API_KEY in .env file")
return None
genai.configure(api_key=api_key)
return genai.GenerativeModel('gemini-1.5-flash')
def analyze_startup(startup_data):
"""Analyze startup using Google AI"""
model = setup_google_ai()
if not model:
return None
prompt = f"""
As an expert startup investment analyst using Google's advanced AI, analyze this startup:
COMPANY: {startup_data['company_name']}
BUSINESS: {startup_data['business_description']}
INDUSTRY: {startup_data.get('industry', 'Not specified')}
STAGE: {startup_data.get('stage', 'Not specified')}
FOUNDER: {startup_data.get('founder_name', 'Not specified')}
Provide a comprehensive analysis including:
1. Market Analysis (size, growth, competition)
2. Business Model Assessment (viability, scalability)
3. Risk Assessment (market, technology, team risks)
4. Investment Recommendation (INVEST/PASS/WATCH with confidence score 1-10)
5. Key Investment Thesis (3-5 bullet points)
6. Due Diligence Priorities
Be specific and actionable for investment decision-making.
"""
try:
response = model.generate_content(prompt)
return response.text
except Exception as e:
return f"Analysis failed: {str(e)}"
# Main app
def main():
st.title("π Startup Analyst Platform")
st.subheader("Powered by Google's Gemini AI")
# Google AI status
col1, col2 = st.columns([3, 1])
with col1:
st.markdown("**π€ Using Google's Gemini 1.5 Flash model for real-time analysis**")
with col2:
if os.getenv("GOOGLE_API_KEY"):
st.success("β
Google AI Connected")
else:
st.error("β Google AI Not Connected")
st.markdown("---")
# Demo scenarios
st.subheader("π― Demo Scenarios")
scenarios = {
"High-Potential AI Startup": {
"company_name": "MedAI Solutions",
"business_description": "AI-powered diagnostic platform that helps doctors identify diseases from medical images with 95% accuracy. Our platform reduces diagnosis time by 70% and improves patient outcomes.",
"industry": "Healthcare AI",
"stage": "Series A",
"founder_name": "Dr. Sarah Chen"
},
"Risky Consumer App": {
"company_name": "SocialSnap",
"business_description": "Social media app for sharing photos with friends. Features include filters, stories, and group chats. Targeting Gen Z users.",
"industry": "Social Media",
"stage": "Seed",
"founder_name": "Mike Johnson"
},
"Watch List B2B SaaS": {
"company_name": "WorkflowAI",
"business_description": "AI-powered workflow automation platform for small businesses. Automates repetitive tasks and improves productivity by 40%.",
"industry": "B2B SaaS",
"stage": "Seed",
"founder_name": "Alex Rodriguez"
}
}
# Scenario selection
selected_scenario = st.selectbox("Choose a demo scenario:", list(scenarios.keys()))
if st.button("π Analyze with Google AI", type="primary"):
startup_data = scenarios[selected_scenario]
# Show analysis progress
with st.spinner("π€ Running Google AI analysis..."):
start_time = time.time()
analysis = analyze_startup(startup_data)
end_time = time.time()
if analysis:
st.success(f"β
Analysis completed in {end_time - start_time:.2f} seconds")
# Display results
st.markdown("---")
st.subheader("π Google AI Analysis Results")
# Show startup info
st.markdown("**Startup Information:**")
col1, col2 = st.columns(2)
with col1:
st.write(f"**Company:** {startup_data['company_name']}")
st.write(f"**Industry:** {startup_data['industry']}")
with col2:
st.write(f"**Stage:** {startup_data['stage']}")
st.write(f"**Founder:** {startup_data['founder_name']}")
st.write(f"**Business:** {startup_data['business_description']}")
# Show analysis
st.markdown("**AI Analysis:**")
st.markdown(analysis)
# Show Google AI branding
st.markdown("---")
st.markdown("**π― This analysis was generated by Google's Gemini AI in real-time!**")
st.markdown("- Using Google's latest AI model")
st.markdown("- Professional investment analysis")
st.markdown("- Ready for hackathon demo")
else:
st.error("Analysis failed. Please check your Google API key.")
if __name__ == "__main__":
main()