| import openai |
| import gradio as gr |
| import os |
|
|
| |
| API_KEY = os.environ["GROQ_API_KEY"] |
|
|
| openai.api_key = API_KEY |
| openai.api_base = "https://api.groq.com/openai/v1" |
|
|
| |
| 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"] |
|
|
| |
| 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)}" |
|
|
| |
| 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() |
|
|