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}