Peter Mutwiri commited on
Commit
19a28b8
Β·
1 Parent(s): c996b34

corrected get orgid in ai querry

Browse files
Files changed (1) hide show
  1. app/routers/ai_query.py +2 -1
app/routers/ai_query.py CHANGED
@@ -10,8 +10,9 @@ router = APIRouter(prefix="/api/v1/ai", tags=["ai"])
10
  @router.post("/query")
11
  async def ai_query(
12
  query: str,
13
- org_id: str = Depends(get_current_user)["org_id"]
14
  ):
 
15
  """RAG endpoint: Question β†’ Vector Search β†’ LLM β†’ Answer"""
16
 
17
  try:
 
10
  @router.post("/query")
11
  async def ai_query(
12
  query: str,
13
+ current_user: dict = Depends(get_current_user) # βœ… Get full dict first
14
  ):
15
+ org_id = current_user["org_id"] # Then extract inside function
16
  """RAG endpoint: Question β†’ Vector Search β†’ LLM β†’ Answer"""
17
 
18
  try: