gcp_document_ai / supabase_models.py
Omkar008's picture
Update supabase_models.py
9da3dbe verified
raw
history blame contribute delete
576 Bytes
from supabase import create_client
from typing import Optional
from functools import lru_cache
from dotenv import load_dotenv
from pydantic import BaseModel
load_dotenv()
import os
@lru_cache(maxsize=1)
class Supabase_Settings(BaseModel):
SUPABASE_URL: str = os.getenv("SUPABASE_URL")
SUPABASE_ANON_KEY: str = os.getenv("SUPABASE_ANON_KEY")
SUPABASE_SERVICE_KEY: str = os.getenv("SUPABASE_SERVICE_KEY")
@lru_cache(maxsize=1)
class Supabase_Client:
values = Supabase_Settings()
instance = create_client(values.SUPABASE_URL, values.SUPABASE_SERVICE_KEY)