Spaces:
Sleeping
Sleeping
from fastapi import FastAPI | |
from pydantic import BaseModel | |
from main import agent | |
app = FastAPI() | |
class Message(BaseModel): | |
text: str | |
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) | |