mgbam commited on
Commit
e19b30e
Β·
verified Β·
1 Parent(s): a437170

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -58
app.py CHANGED
@@ -1,58 +1,21 @@
1
- import streamlit as st
2
- import requests
3
- import time
4
-
5
- # Gemini + GPT-4 fallback support
6
- GEMINI_API_KEY = st.secrets.get("GEMINI_API_KEY", "your-gemini-api-key")
7
- OPENAI_API_KEY = st.secrets.get("OPENAI_API_KEY", "your-openai-api-key")
8
-
9
- GEMINI_ENDPOINT = "https://generativelanguage.googleapis.com/v1/models/gemini-1.5-pro:generateContent"
10
-
11
- import openai
12
- openai.api_key = OPENAI_API_KEY
13
-
14
- def call_openai(prompt):
15
- try:
16
- response = openai.ChatCompletion.create(
17
- model="gpt-4",
18
- messages=[{"role": "user", "content": prompt}],
19
- temperature=0.7
20
- )
21
- return response['choices'][0]['message']['content']
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)")