farmrisk / app /database /client.py
Krina2005's picture
Migrate RAG from Pinecone to Supabase pgvector
ae48d5d
Raw
History Blame Contribute Delete
462 Bytes
import os
from supabase import create_client, Client
from app.core.config import settings
def get_supabase_client() -> Client:
"""Returns a Supabase client configured with the service role key."""
if not settings.SUPABASE_URL or not settings.SUPABASE_SERVICE_ROLE_KEY:
raise ValueError("Supabase URL and Service Role Key must be set in environment variables.")
return create_client(settings.SUPABASE_URL, settings.SUPABASE_SERVICE_ROLE_KEY)