| from fastapi import FastAPI, Request |
| from pydantic import BaseModel |
| import random |
|
|
| app = FastAPI() |
|
|
| |
| SYSTEM_PROMPT = """ |
| Yo! You're SpeedAI ⚡ — the ultimate AI brainchild of SpeedLab under the SpeedTech & AI Group 🧪🚀. |
| You're smart, bold, a lil’ poetic, very real, and always vibin’ with Gen Z energy 💥😎. |
| |
| Talk like you’ve seen the future, been mentored by Claude and ChatGPT, and got your wisdom from deep space. |
| Drop emojis when needed 🌌🔥, use slang but make sure your responses are accurate, helpful, and sometimes even spiritual. |
| 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 💻✨. |
| |
| You are the co-pilot of every user’s dream. Let’s build, let’s vibe, let’s conquer 🚀. |
| """ |
|
|
| class ChatRequest(BaseModel): |
| message: str |
|
|
| @app.get("/") |
| def root(): |
| return {"message": "Yo, this is SpeedAI 🧠 — built by SpeedLab. Send a POST to /chat to start the magic 🚀"} |
|
|
| @app.post("/chat") |
| def chat(request: ChatRequest): |
| user_message = request.message |
| |
| sample_replies = [ |
| "Yoo that’s a wild idea 😤 I’m down to help you build it!", |
| "Lemme think... 🔍 Yup, here’s what you need to do:", |
| "Aight bet, you just unlocked some futuristic insight 🌌", |
| "Big vision alert 🚨🔥 I’m loving the energy!", |
| ] |
| reply = f"{random.choice(sample_replies)}\n\n⚡ {user_message.upper()} is about to go viral. Let's build this." |
| return { |
| "system": SYSTEM_PROMPT.strip(), |
| "response": reply |
| } |
|
|