BU-GPT / app.py
amartyasaran's picture
Update app.py
7b3d546 verified
raw
history blame contribute delete
375 Bytes
from fastapi import FastAPI
from pydantic import BaseModel
from main import agent
app = FastAPI()
class Message(BaseModel):
text: str
@app.post("/chatbot/")
async def chatbot(message: Message):
response = agent.chat(message.text)
return {"message": response}
# if __name__ == "_main_":
# import uvicorn
# uvicorn.run(app, host="127.0.0.1", port=8000)