puzan789's picture
updated
ad87194
raw
history blame
568 Bytes
class LimitChecker:
def __init__(self, supabase_client):
limits = self.fetch_limits(supabase_client)
self.url_limit = limits.get("total_website_url")
self.pdf_limit = limits.get("text_pdf_limit")
self.image_pdf_limit = limits.get("image_pdf_limit")
def fetch_limits(self, supabase_client):
table = supabase_client.table("ChatAI_limit_check")
results = table.select("*").execute()
return results.data[0]
def __iter__(self):
return iter((self.url_limit, self.pdf_limit, self.image_pdf_limit))