File size: 1,241 Bytes
b42d12d
71643a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b42d12d
71643a3
 
 
b42d12d
71643a3
 
 
b42d12d
 
71643a3
b42d12d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import uvicorn
import os
import requests
import json
import base64
import re
import logging
from pydantic import BaseModel
from typing import Union, Annotated, Optional, List, Dict, Any
from base64 import b64decode

from fastapi import FastAPI, Depends, HTTPException, status, UploadFile, File, Response, Request, Header
from fastapi.staticfiles import StaticFiles
from fastapi.responses import FileResponse
import nest_asyncio

logging.basicConfig(level=logging.ERROR)

app = FastAPI(
 title="TikTok",
 version="1.0.0",
 contact={
  "name": "RendyDev",
  "url": "https://github.com/TeamKillerX/RyuzakiLib/",
 },
 docs_url=None, redoc_url="/"
)

class SuccessResponse(BaseModel):
    status: str
    rootx: Dict[str, Any]

class ErrorResponse(BaseModel):
    status: str
    detail: str

class ErrorStatus(BaseModel):
    status: str
    message: str

class ChatBots(BaseModel):
    query: str
    user_id: Optional[int] = None
    bot_name: Optional[str] = None
    bot_username: Optional[str] = None

class TranslateCustom(BaseModel):
    text: str
    setlang: str

@app.get("/status")
def status():
    return {"message": "running"}
    
if __name__ == "__main__":
    nest_asyncio.apply()
    uvicorn.run(app, host="0.0.0.0", port=7860)