larkWe also need the supabase package:%pip install supabaseSince we are using SupabaseVectorStore and OpenAIEmbeddings, we have to load their API keys.To find your SUPABASE_URL and SUPABASE_SERVICE_KEY, head to your Supabase project's API settings.SUPABASE_URL corresponds to the Project URLSUPABASE_SERVICE_KEY corresponds to the service_role API keyTo get your OPENAI_API_KEY, navigate to API keys on your OpenAI account and create a new secret key.import osimport getpassos.environ["SUPABASE_URL"] = getpass.getpass("Supabase URL:")os.environ["SUPABASE_SERVICE_KEY"] = getpass.getpass("Supabase Service Key:")os.environ["OPENAI_API_KEY"] = getpass.getpass("OpenAI API Key:")Optional: If you're storing your Supabase and OpenAI API keys in a .env file, you can load them with dotenv.%pip install python-dotenvfrom dotenv import load_dotenvload_dotenv()First we'll create a Supabase client and instantiate a OpenAI embeddings class.import osfrom supabase.client import Client, create_clientfrom langchain.schema import Documentfrom langchain.embeddings.openai import OpenAIEmbeddingsfrom langchain.vectorstores import SupabaseVectorStoresupabase_url = os.environ.get("SUPABASE_URL")supabase_key = os.environ.get("SUPABASE_SERVICE_KEY")supabase: Client = create_client(supabase_url, supabase_key)embeddings = OpenAIEmbeddings()Next let's create our documents.docs = [    Document(        page_content="A bunch of scientists bring back dinosaurs and mayhem breaks loose",        metadata={"year": 1993, "rating": 7.7, "genre": "science fiction"},    ),    Document(        page_content="Leo DiCaprio gets lost in a dream within a dream within a dream within a ...",        metadata={"year": 2010, "director": "Christopher Nolan", "rating": 8.2},    ),    Document(        page_content="A psychologist / detective gets lost in a series of dreams within dreams within dreams and Inception reused the idea",        metadata={"year": 2006, "director": "Satoshi Kon", "rating": 8.6},    ),    Document(
Supabase is an open-source Firebase alternative.
Supabase is an open-source Firebase alternative. ->: larkWe also need the supabase package:%pip install supabaseSince we are using SupabaseVectorStore and OpenAIEmbeddings, we have to load their API keys.To find your SUPABASE_URL and SUPABASE_SERVICE_KEY, head to your Supabase project's API settings.SUPABASE_URL corresponds to the Project URLSUPABASE_SERVICE_KEY corresponds to the service_role API keyTo get your OPENAI_API_KEY, navigate to API keys on your OpenAI account and create a new secret key.import osimport getpassos.environ["SUPABASE_URL"] = getpass.getpass("Supabase URL:")os.environ["SUPABASE_SERVICE_KEY"] = getpass.getpass("Supabase Service Key:")os.environ["OPENAI_API_KEY"] = getpass.getpass("OpenAI API Key:")Optional: If you're storing your Supabase and OpenAI API keys in a .env file, you can load them with dotenv.%pip install python-dotenvfrom dotenv import load_dotenvload_dotenv()First we'll create a Supabase client and instantiate a OpenAI embeddings class.import osfrom supabase.client import Client, create_clientfrom langchain.schema import Documentfrom langchain.embeddings.openai import OpenAIEmbeddingsfrom langchain.vectorstores import SupabaseVectorStoresupabase_url = os.environ.get("SUPABASE_URL")supabase_key = os.environ.get("SUPABASE_SERVICE_KEY")supabase: Client = create_client(supabase_url, supabase_key)embeddings = OpenAIEmbeddings()Next let's create our documents.docs = [    Document(        page_content="A bunch of scientists bring back dinosaurs and mayhem breaks loose",        metadata={"year": 1993, "rating": 7.7, "genre": "science fiction"},    ),    Document(        page_content="Leo DiCaprio gets lost in a dream within a dream within a dream within a ...",        metadata={"year": 2010, "director": "Christopher Nolan", "rating": 8.2},    ),    Document(        page_content="A psychologist / detective gets lost in a series of dreams within dreams within dreams and Inception reused the idea",        metadata={"year": 2006, "director": "Satoshi Kon", "rating": 8.6},    ),    Document(