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))