backend / dependencies.py
muhammadhasnain100's picture
Cursor
Add FastAPI routes, admin panel, RAG CSV merge, React frontend
c5cf697
Raw History Blame Contribute Delete
439 Bytes
from typing import Annotated
from fastapi import Depends, Request
from chatbot import Comsatsbot
from security import get_current_admin_id, get_current_user_id
def get_chatbot(request: Request) -> Comsatsbot:
return request.app.state.chatbot
ChatbotDep = Annotated[Comsatsbot, Depends(get_chatbot)]
CurrentUserIdDep = Annotated[str, Depends(get_current_user_id)]
CurrentAdminIdDep = Annotated[str, Depends(get_current_admin_id)]