Update app.py
Browse files
app.py
CHANGED
@@ -1,58 +1,21 @@
|
|
1 |
-
|
2 |
-
import
|
3 |
-
import
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
except Exception as e:
|
23 |
-
return f"OpenAI Error: {str(e)}"
|
24 |
-
|
25 |
-
def call_gemini(prompt):
|
26 |
-
headers = {"Content-Type": "application/json"}
|
27 |
-
params = {"key": GEMINI_API_KEY}
|
28 |
-
payload = {"contents": [{"parts": [{"text": prompt}]}]}
|
29 |
-
response = requests.post(GEMINI_ENDPOINT, headers=headers, params=params, json=payload)
|
30 |
-
if response.status_code == 200:
|
31 |
-
return response.json()['candidates'][0]['content']['parts'][0]['text']
|
32 |
-
else:
|
33 |
-
return call_openai(prompt)
|
34 |
-
|
35 |
-
st.set_page_config(page_title="AutoExec AI", layout="wide")
|
36 |
-
st.title("π AutoExec AI: Autonomous AI Business Launcher")
|
37 |
-
|
38 |
-
st.sidebar.header("Business Setup")
|
39 |
-
niche = st.sidebar.text_input("Niche (e.g. fitness, pets)")
|
40 |
-
ad_budget = st.sidebar.slider("Ad Budget per Day", 5, 100, 10)
|
41 |
-
business_type = st.sidebar.selectbox("Business Type", ["Dropshipping", "Print-on-Demand", "Newsletter", "Course"])
|
42 |
-
platforms = st.sidebar.multiselect("E-Commerce Platforms", ["Shopify", "Gumroad", "WooCommerce"])
|
43 |
-
run = st.sidebar.button("Launch")
|
44 |
-
|
45 |
-
if run:
|
46 |
-
strategy = call_gemini(f"Give me a viral business idea in the {niche} niche using {business_type}")
|
47 |
-
st.subheader("π Strategy")
|
48 |
-
st.markdown(strategy)
|
49 |
-
|
50 |
-
copy = call_gemini(f"Write a product description and landing page for a {niche} {business_type}")
|
51 |
-
st.subheader("π Copy")
|
52 |
-
st.markdown(copy)
|
53 |
-
|
54 |
-
ads = call_gemini(f"Create a $ {ad_budget}/day ad campaign for a {niche} product.")
|
55 |
-
st.subheader("πΈ Ad Campaign")
|
56 |
-
st.markdown(ads)
|
57 |
-
|
58 |
-
st.success("Business Ready to Deploy")
|
|
|
1 |
+
from landing import render_landing
|
2 |
+
from agent_manager import run_agents
|
3 |
+
from dashboard.logs import show_logs
|
4 |
+
|
5 |
+
st.set_page_config(page_title="AutoExec AI SaaS", layout="wide")
|
6 |
+
|
7 |
+
# Sidebar navigation
|
8 |
+
tab = st.sidebar.selectbox("Navigation", ["Home", "Launch", "Agent Logs", "Settings"])
|
9 |
+
|
10 |
+
if tab == "Home":
|
11 |
+
render_landing()
|
12 |
+
elif tab == "Launch":
|
13 |
+
niche = st.text_input("Niche (e.g. fitness, productivity)")
|
14 |
+
biz_type = st.selectbox("Business Type", ["Dropshipping", "Print-on-Demand", "Newsletter", "Course"])
|
15 |
+
if st.button("π Launch Business"):
|
16 |
+
results = run_agents(niche, biz_type)
|
17 |
+
st.write(results)
|
18 |
+
elif tab == "Agent Logs":
|
19 |
+
show_logs()
|
20 |
+
elif tab == "Settings":
|
21 |
+
st.write("Settings placeholder (e.g., API keys, billing)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|