ilsa15 commited on
Commit
b5c466a
·
verified ·
1 Parent(s): 4efdac4

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -0
app.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from groq import Groq
3
+ import os
4
+
5
+ # Get your key from environment variable
6
+ GROQ_API_KEY = os.getenv("GROQ_API_KEY")
7
+
8
+ client = Groq(api_key=GROQ_API_KEY)
9
+
10
+ # Analysis function
11
+ def validate_idea(idea):
12
+ if not idea.strip():
13
+ return "❌ Please enter a startup idea."
14
+
15
+ response = client.chat.completions.create(
16
+ model="llama3-8b-8192",
17
+ messages=[
18
+ {"role": "system", "content": "You're a startup analyst who evaluates business ideas."},
19
+ {"role": "user", "content": f"Analyze the following startup idea:\n\n{idea}\n\nGive a brief SWOT analysis, potential audience, tech feasibility, and market fit."}
20
+ ],
21
+ temperature=0.7
22
+ )
23
+ return response.choices[0].message.content
24
+
25
+ # Gradio Interface
26
+ gr.Interface(
27
+ fn=validate_idea,
28
+ inputs=gr.Textbox(label="Your Startup Idea", lines=6, placeholder="Describe your idea..."),
29
+ outputs=gr.Markdown(label="AI Validation Report"),
30
+ title="🚀 Startup Idea Validator",
31
+ description="Validate your startup idea using Groq's LLM."
32
+ ).launch()