2023-08-03 10:53:38 +03:00
|
|
|
from logger import get_logger
|
2023-08-02 00:03:47 +03:00
|
|
|
from models.databases.supabase import (
|
2023-11-07 16:03:50 +03:00
|
|
|
ApiBrainDefinitions,
|
2023-08-03 10:53:38 +03:00
|
|
|
ApiKeyHandler,
|
2023-08-02 00:03:47 +03:00
|
|
|
Brain,
|
|
|
|
BrainSubscription,
|
|
|
|
Chats,
|
2023-08-03 10:53:38 +03:00
|
|
|
File,
|
2023-09-20 10:35:37 +03:00
|
|
|
Knowledges,
|
2023-09-07 14:22:06 +03:00
|
|
|
Notifications,
|
2023-10-05 10:47:29 +03:00
|
|
|
Onboarding,
|
2023-08-03 10:53:38 +03:00
|
|
|
Prompts,
|
2023-08-21 15:05:13 +03:00
|
|
|
UserUsage,
|
2023-08-02 00:03:47 +03:00
|
|
|
Vector,
|
|
|
|
)
|
|
|
|
|
|
|
|
logger = get_logger(__name__)
|
|
|
|
|
|
|
|
|
2023-08-03 10:53:38 +03:00
|
|
|
class SupabaseDB(
|
2023-08-21 15:05:13 +03:00
|
|
|
Brain,
|
|
|
|
UserUsage,
|
|
|
|
File,
|
|
|
|
BrainSubscription,
|
|
|
|
ApiKeyHandler,
|
|
|
|
Chats,
|
|
|
|
Vector,
|
2023-10-05 10:47:29 +03:00
|
|
|
Onboarding,
|
2023-08-21 15:05:13 +03:00
|
|
|
Prompts,
|
2023-09-07 14:22:06 +03:00
|
|
|
Notifications,
|
2023-09-20 10:35:37 +03:00
|
|
|
Knowledges,
|
2023-11-07 16:03:50 +03:00
|
|
|
ApiBrainDefinitions,
|
2023-08-03 10:53:38 +03:00
|
|
|
):
|
2023-08-02 00:03:47 +03:00
|
|
|
def __init__(self, supabase_client):
|
|
|
|
self.db = supabase_client
|
|
|
|
Brain.__init__(self, supabase_client)
|
2023-08-21 15:05:13 +03:00
|
|
|
UserUsage.__init__(self, supabase_client)
|
2023-08-02 00:03:47 +03:00
|
|
|
File.__init__(self, supabase_client)
|
|
|
|
BrainSubscription.__init__(self, supabase_client)
|
|
|
|
ApiKeyHandler.__init__(self, supabase_client)
|
|
|
|
Chats.__init__(self, supabase_client)
|
|
|
|
Vector.__init__(self, supabase_client)
|
2023-08-03 10:53:38 +03:00
|
|
|
Prompts.__init__(self, supabase_client)
|
2023-09-07 14:22:06 +03:00
|
|
|
Notifications.__init__(self, supabase_client)
|
2023-09-20 10:35:37 +03:00
|
|
|
Knowledges.__init__(self, supabase_client)
|
2023-10-05 10:47:29 +03:00
|
|
|
Onboarding.__init__(self, supabase_client)
|
2023-11-07 16:03:50 +03:00
|
|
|
ApiBrainDefinitions.__init__(self, supabase_client)
|