Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,37 @@ app = FastAPI(title="Tessai LLM Bridge", version="0.1.0")
|
|
| 12 |
# Models
|
| 13 |
# -----------------------------
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
class ChatRequest(BaseModel):
|
| 17 |
session_id: str
|
|
|
|
| 12 |
# Models
|
| 13 |
# -----------------------------
|
| 14 |
|
| 15 |
+
@app.get("/", response_class=HTMLResponse)
|
| 16 |
+
async def root():
|
| 17 |
+
return """
|
| 18 |
+
<!doctype html>
|
| 19 |
+
<html>
|
| 20 |
+
<head>
|
| 21 |
+
<meta charset="utf-8" />
|
| 22 |
+
<title>Tessai LLM Bridge</title>
|
| 23 |
+
<style>
|
| 24 |
+
body {
|
| 25 |
+
font-family: system-ui, sans-serif;
|
| 26 |
+
padding: 2rem;
|
| 27 |
+
}
|
| 28 |
+
code {
|
| 29 |
+
background: #f4f4f4;
|
| 30 |
+
padding: 0.1rem 0.3rem;
|
| 31 |
+
border-radius: 3px;
|
| 32 |
+
}
|
| 33 |
+
</style>
|
| 34 |
+
</head>
|
| 35 |
+
<body>
|
| 36 |
+
<h1>Tessai LLM Bridge</h1>
|
| 37 |
+
<p>FastAPI is running inside this Hugging Face Space.</p>
|
| 38 |
+
<ul>
|
| 39 |
+
<li><code>GET /health</code> – health and metrics</li>
|
| 40 |
+
<li><code>POST /v1/chat</code> – main chat endpoint</li>
|
| 41 |
+
<li><code>GET /admin</code> – simple meter board</li>
|
| 42 |
+
</ul>
|
| 43 |
+
</body>
|
| 44 |
+
</html>
|
| 45 |
+
"""
|
| 46 |
|
| 47 |
class ChatRequest(BaseModel):
|
| 48 |
session_id: str
|