Voffchik commited on
Commit
2b704d8
·
verified ·
1 Parent(s): 65a690d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
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
- # result = needModel(request.text)[0]
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)}