ml-server / src /server /routes.py
Partha11's picture
added project files from private repo
ae2ef1b
raw
history blame contribute delete
463 Bytes
from fastapi import Body, FastAPI
from typing_extensions import Annotated
from src.models.request import Request
class Routes:
def __init__(self):
self.api = FastAPI()
@api.get('/')
async def index(self):
return {'message': 'Hello World!'}
api = FastAPI()
@api.post('/query')
async def query(data: Annotated[Request, Body(embed=True)]):
handler = Handler(data.query)
response = handler.tag()
return {'data': response}