Update app.py
Browse files
app.py
CHANGED
|
@@ -4,12 +4,15 @@ import os
|
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
|
|
|
|
| 9 |
@app.get("/")
|
| 10 |
def home():
|
| 11 |
return {"message": "Molbot is running 🚀"}
|
| 12 |
|
|
|
|
| 13 |
@app.post("/chat")
|
| 14 |
async def chat(request: Request):
|
| 15 |
data = await request.json()
|
|
|
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
+
# OpenRouter API key
|
| 8 |
+
OPENROUTER_API_KEY = os.getenv("OPENROUTER_API_KEY")
|
| 9 |
|
| 10 |
+
# Root route
|
| 11 |
@app.get("/")
|
| 12 |
def home():
|
| 13 |
return {"message": "Molbot is running 🚀"}
|
| 14 |
|
| 15 |
+
# Chat route
|
| 16 |
@app.post("/chat")
|
| 17 |
async def chat(request: Request):
|
| 18 |
data = await request.json()
|