docker_fastapi / app.py
thesunshine36's picture
Update app.py
87a5d7a
raw
history blame
No virus
565 Bytes
from fastapi import FastAPI
import uvicorn
from config import api_parameter
from datetime import datetime
from model_config import console_chat
# Get time
date = datetime.now().strftime("%d-%m")
app = FastAPI()
object = "runServer/app"
# FastAPI
@app.get("/")
def read_root():
return f"Version {date}"
@app.post("/")
def return_api(text: str):
# Get the caption
print(text)
response= console_chat.chat(text)
print(response)
# Return message
return response
# uvicorn.run(app, host=api_parameter.ip, port=int(api_parameter.port))