Spaces:
Runtime error
Runtime error
from fastapi import FastAPI, Request | |
from fastapi.responses import HTMLResponse | |
from fastapi.templating import Jinja2Templates | |
from chat import chat_conversations | |
import spacy | |
app = FastAPI() | |
templates = Jinja2Templates(directory="templates") | |
async def read_root(request: Request): | |
return templates.TemplateResponse("chatwidget.html", {"request": request}) | |
async def read_root(request: Request): | |
return templates.TemplateResponse("chatwidget.html", {"request": request}) | |
async def read_root(request: Request): | |
print(request) | |
form_data = await request.json() | |
query = form_data.get('query') | |
response_text = chat_conversations(query) | |
return response_text | |