JugaadGPT / app.py
temii001's picture
Update app.py
d1b0bb8 verified
import openai
import gradio as gr
import os
# Get your Groq API key from Hugging Face Secrets
API_KEY = os.environ["GROQ_API_KEY"]
openai.api_key = API_KEY
openai.api_base = "https://api.groq.com/openai/v1"
# Dropdown options
budgets = ["No Money", "Under $50", "Under $200", "Student Budget", "Freelancer Budget"]
niches = ["Tech", "Food", "Education", "Freelancing", "Art & Design", "Fashion", "Home Services", "Entertainment", "Social Media", "AI Tools"]
# Groq prompt function
def generate_ideas(budget, niche):
prompt = f"""
You are a business idea generator helping people with limited budgets.
Give **exactly 2** practical startup ideas for the following:
- Niche: {niche}
- Budget: {budget}
For each idea, use this format:
**πŸ’‘ Idea Name:**
One short sentence about what it does.
**πŸ›  Tools Needed:**
3 bullet points max.
**πŸš€ How to Start:**
Keep it under 3 steps.
**πŸ“£ First Marketing Step:**
One creative idea.
Keep it **concise**, well-formatted, and inspiring."""
try:
response = openai.ChatCompletion.create(
model="llama3-8b-8192",
messages=[
{"role": "system", "content": "You are a business mentor giving low-budget startup ideas."},
{"role": "user", "content": prompt}
]
)
return response['choices'][0]['message']['content'].strip()
except Exception as e:
return f"❌ Error: {str(e)}"
# Gradio UI
gr.Interface(
fn=generate_ideas,
inputs=[
gr.Dropdown(budgets, label="Select Your Budget", value="No Money"),
gr.Dropdown(niches, label="Select a Niche", value="Freelancing")
],
outputs=gr.Textbox(label="Startup Ideas"),
title="πŸš€ JugaadGPT – Startup Idea Generator",
description="Generate practical low-budget startup ideas using Groq's LLaMA3 model"
).launch()