quivr/backend/repository/chat/get_user_chats.py

11 lines
281 B
Python
Raw Normal View History

2023-06-28 20:39:27 +03:00
from typing import List
from models import Chat, get_supabase_db
2023-06-28 20:39:27 +03:00
def get_user_chats(user_id: str) -> List[Chat]:
supabase_db = get_supabase_db()
response = supabase_db.get_user_chats(user_id)
chats = [Chat(chat_dict) for chat_dict in response.data]
return chats