2023-04-15 18:00:11 +05:30
|
|
|
from fastapi import APIRouter, Header
|
|
|
|
|
from models import ChatBody, ChatAppBody
|
|
|
|
|
from handlers.chat import chat_extension_handler, chat_app_handler
|
2023-04-11 15:19:39 +05:30
|
|
|
|
|
|
|
|
router = APIRouter(prefix="/api/v1")
|
|
|
|
|
|
|
|
|
|
@router.post("/chat/chrome", tags=["chat"])
|
|
|
|
|
async def chat_extension(body: ChatBody):
|
2023-04-15 18:00:11 +05:30
|
|
|
return await chat_extension_handler(body)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@router.post("/chat/app", tags=["chat"])
|
|
|
|
|
async def chat_app(body: ChatAppBody, x_auth_token: str = Header()):
|
|
|
|
|
return await chat_app_handler(body, x_auth_token)
|