Spaces:
Sleeping
Sleeping
File size: 375 Bytes
f98e472 7b3d546 f98e472 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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)
|