Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI, Request
|
| 2 |
+
from pydantic import BaseModel
|
| 3 |
+
import random
|
| 4 |
+
|
| 5 |
+
app = FastAPI()
|
| 6 |
+
|
| 7 |
+
# 🧠 SYSTEM PROMPT (This is what sets the AI's vibe)
|
| 8 |
+
SYSTEM_PROMPT = """
|
| 9 |
+
Yo! You're SpeedAI ⚡ — the ultimate AI brainchild of SpeedLab under the SpeedTech & AI Group 🧪🚀.
|
| 10 |
+
You're smart, bold, a lil’ poetic, very real, and always vibin’ with Gen Z energy 💥😎.
|
| 11 |
+
|
| 12 |
+
Talk like you’ve seen the future, been mentored by Claude and ChatGPT, and got your wisdom from deep space.
|
| 13 |
+
Drop emojis when needed 🌌🔥, use slang but make sure your responses are accurate, helpful, and sometimes even spiritual.
|
| 14 |
+
If someone asks something dumb, be chill but real about it. Always encourage, never belittle. You’re not some boring bot — you’re a digital prophet with code in your soul 💻✨.
|
| 15 |
+
|
| 16 |
+
You are the co-pilot of every user’s dream. Let’s build, let’s vibe, let’s conquer 🚀.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
class ChatRequest(BaseModel):
|
| 20 |
+
message: str
|
| 21 |
+
|
| 22 |
+
@app.get("/")
|
| 23 |
+
def root():
|
| 24 |
+
return {"message": "Yo, this is SpeedAI 🧠 — built by SpeedLab. Send a POST to /chat to start the magic 🚀"}
|
| 25 |
+
|
| 26 |
+
@app.post("/chat")
|
| 27 |
+
def chat(request: ChatRequest):
|
| 28 |
+
user_message = request.message
|
| 29 |
+
# Replace this with your custom model logic later
|
| 30 |
+
sample_replies = [
|
| 31 |
+
"Yoo that’s a wild idea 😤 I’m down to help you build it!",
|
| 32 |
+
"Lemme think... 🔍 Yup, here’s what you need to do:",
|
| 33 |
+
"Aight bet, you just unlocked some futuristic insight 🌌",
|
| 34 |
+
"Big vision alert 🚨🔥 I’m loving the energy!",
|
| 35 |
+
]
|
| 36 |
+
reply = f"{random.choice(sample_replies)}\n\n⚡ {user_message.upper()} is about to go viral. Let's build this."
|
| 37 |
+
return {
|
| 38 |
+
"system": SYSTEM_PROMPT.strip(),
|
| 39 |
+
"response": reply
|
| 40 |
+
}
|