import DeepLakeimport osimport getpassos.environ["OPENAI_API_KEY"] = getpass.getpass("OpenAI API Key:")activeloop_token = getpass.getpass("activeloop token:")embeddings = OpenAIEmbeddings()from langchain.document_loaders import TextLoaderloader = TextLoader("../../modules/state_of_the_union.txt")documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)docs = text_splitter.split_documents(documents)embeddings = OpenAIEmbeddings()Create a local dataset‚ÄãCreate a dataset locally at ./deeplake/, then run similarity search. The Deeplake+LangChain integration uses Deep Lake datasets under the hood, so dataset and vector store are used interchangeably. To create a dataset in your own cloud, or in the Deep Lake storage, adjust the path accordingly.db = DeepLake(    dataset_path="./my_deeplake/", embedding=embeddings, overwrite=True)db.add_documents(docs)# or shorter# db = DeepLake.from_documents(docs, dataset_path="./my_deeplake/", embedding=embeddings, overwrite=True)Query dataset‚Äãquery = "What did the president say about Ketanji Brown Jackson"docs = db.similarity_search(query)        Dataset(path='./my_deeplake/', tensors=['embedding', 'id', 'metadata', 'text'])          tensor      htype      shape      dtype  compression      -------    -------    -------    -------  -------      embedding  embedding  (42, 1536)  float32   None           id        text      (42, 1)      str     None        metadata     json      (42, 1)      str     None          text       text      (42, 1)      str     None       To disable dataset summary printings all the time, you can specify verbose=False during VectorStore initialization.print(docs[0].page_content)    Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you‚Äôre at it, pass the Disclose Act so Americans can know who is funding our elections.         Tonight, I‚Äôd like to honor someone who has dedicated his life to serve this
Activeloop Deep Lake as a Multi-Modal Vector Store that stores embeddings and their metadata including text, Jsons, images, audio, video, and more. It saves the data locally, in your cloud, or on Activeloop storage. It performs hybrid search including embeddings and their attributes.
Activeloop Deep Lake as a Multi-Modal Vector Store that stores embeddings and their metadata including text, Jsons, images, audio, video, and more. It saves the data locally, in your cloud, or on Activeloop storage. It performs hybrid search including embeddings and their attributes. ->: import DeepLakeimport osimport getpassos.environ["OPENAI_API_KEY"] = getpass.getpass("OpenAI API Key:")activeloop_token = getpass.getpass("activeloop token:")embeddings = OpenAIEmbeddings()from langchain.document_loaders import TextLoaderloader = TextLoader("../../modules/state_of_the_union.txt")documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)docs = text_splitter.split_documents(documents)embeddings = OpenAIEmbeddings()Create a local dataset‚ÄãCreate a dataset locally at ./deeplake/, then run similarity search. The Deeplake+LangChain integration uses Deep Lake datasets under the hood, so dataset and vector store are used interchangeably. To create a dataset in your own cloud, or in the Deep Lake storage, adjust the path accordingly.db = DeepLake(    dataset_path="./my_deeplake/", embedding=embeddings, overwrite=True)db.add_documents(docs)# or shorter# db = DeepLake.from_documents(docs, dataset_path="./my_deeplake/", embedding=embeddings, overwrite=True)Query dataset‚Äãquery = "What did the president say about Ketanji Brown Jackson"docs = db.similarity_search(query)        Dataset(path='./my_deeplake/', tensors=['embedding', 'id', 'metadata', 'text'])          tensor      htype      shape      dtype  compression      -------    -------    -------    -------  -------      embedding  embedding  (42, 1536)  float32   None           id        text      (42, 1)      str     None        metadata     json      (42, 1)      str     None          text       text      (42, 1)      str     None       To disable dataset summary printings all the time, you can specify verbose=False during VectorStore initialization.print(docs[0].page_content)    Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you‚Äôre at it, pass the Disclose Act so Americans can know who is funding our elections.         Tonight, I‚Äôd like to honor someone who has dedicated his life to serve this