File size: 565 Bytes
87a5d7a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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))