Create api/routes.py
Browse files- ai-bot/api/routes.py +8 -0
ai-bot/api/routes.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import APIRouter
|
| 2 |
+
from services.chat_service import chat
|
| 3 |
+
|
| 4 |
+
router = APIRouter()
|
| 5 |
+
|
| 6 |
+
@router.post("/chat")
|
| 7 |
+
def chat_endpoint(message: dict):
|
| 8 |
+
return chat(message["text"])
|