Update app.py
Browse files
app.py
CHANGED
|
@@ -16,12 +16,11 @@ app = FastAPI(lifespan=lifespan)
|
|
| 16 |
class TextRequest(BaseModel):
|
| 17 |
text: str
|
| 18 |
|
|
|
|
| 19 |
@app.post("/message")
|
| 20 |
async def model(request: TextRequest):
|
| 21 |
try:
|
| 22 |
-
#
|
| 23 |
-
result
|
| 24 |
-
"text": "hi from api!"}
|
| 25 |
-
return result
|
| 26 |
except Exception as e:
|
| 27 |
-
return {"error": str(e)}
|
|
|
|
| 16 |
class TextRequest(BaseModel):
|
| 17 |
text: str
|
| 18 |
|
| 19 |
+
@app.post("/message")
|
| 20 |
@app.post("/message")
|
| 21 |
async def model(request: TextRequest):
|
| 22 |
try:
|
| 23 |
+
# Возвращаем текст в верхнем регистре
|
| 24 |
+
return {"result": request.text.upper()}
|
|
|
|
|
|
|
| 25 |
except Exception as e:
|
| 26 |
+
return {"error": str(e)}
|