Update app.py
Browse files
app.py
CHANGED
|
@@ -266,7 +266,7 @@ async def root():
|
|
| 266 |
|
| 267 |
@app.post('/v1/chat/completions')
|
| 268 |
@app.post('/chat/completions')
|
| 269 |
-
async def chat_completions(request: Request
|
| 270 |
logger.debug('запрос `completions`')
|
| 271 |
data = await request.json()
|
| 272 |
messages = data.get('messages', [])
|
|
@@ -295,14 +295,14 @@ async def models():
|
|
| 295 |
|
| 296 |
|
| 297 |
@app.get('/update_token')
|
| 298 |
-
async def update_token(
|
| 299 |
logger.info('запрос `update_token`')
|
| 300 |
task = get_token()
|
| 301 |
return JSONResponse({'status': 'обновление токена запущено'}, status_code=200, media_type='application/json')
|
| 302 |
|
| 303 |
|
| 304 |
@app.get('/show_last_screen')
|
| 305 |
-
async def show_last_screen(
|
| 306 |
logger.info('запрос `show_last_screen`')
|
| 307 |
return FileResponse(screenshot_path.resolve().as_posix(), media_type='image/jpeg', status_code=200)
|
| 308 |
|
|
|
|
| 266 |
|
| 267 |
@app.post('/v1/chat/completions')
|
| 268 |
@app.post('/chat/completions')
|
| 269 |
+
async def chat_completions(request: Request):
|
| 270 |
logger.debug('запрос `completions`')
|
| 271 |
data = await request.json()
|
| 272 |
messages = data.get('messages', [])
|
|
|
|
| 295 |
|
| 296 |
|
| 297 |
@app.get('/update_token')
|
| 298 |
+
async def update_token():
|
| 299 |
logger.info('запрос `update_token`')
|
| 300 |
task = get_token()
|
| 301 |
return JSONResponse({'status': 'обновление токена запущено'}, status_code=200, media_type='application/json')
|
| 302 |
|
| 303 |
|
| 304 |
@app.get('/show_last_screen')
|
| 305 |
+
async def show_last_screen():
|
| 306 |
logger.info('запрос `show_last_screen`')
|
| 307 |
return FileResponse(screenshot_path.resolve().as_posix(), media_type='image/jpeg', status_code=200)
|
| 308 |
|