From 9cf6661dc55043b572b5e19a67450c82115b8f15 Mon Sep 17 00:00:00 2001 From: kartikTAI <129414343+kartikTAI@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:05:01 -0600 Subject: [PATCH] community: use NeuralDB object to initialize NeuralDBVectorStore (#17272) **Description:** This PR adds an `__init__` method to the NeuralDBVectorStore class, which takes in a NeuralDB object to instantiate the state of NeuralDBVectorStore. **Issue:** N/A **Dependencies:** N/A **Twitter handle:** N/A --- .../vectorstores/thirdai_neuraldb.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/libs/community/langchain_community/vectorstores/thirdai_neuraldb.py b/libs/community/langchain_community/vectorstores/thirdai_neuraldb.py index 444f7d14f8..053ae4b65e 100644 --- a/libs/community/langchain_community/vectorstores/thirdai_neuraldb.py +++ b/libs/community/langchain_community/vectorstores/thirdai_neuraldb.py @@ -12,7 +12,22 @@ from langchain_core.vectorstores import VectorStore class NeuralDBVectorStore(VectorStore): - """Vectorstore that uses ThirdAI's NeuralDB.""" + """Vectorstore that uses ThirdAI's NeuralDB. + + To use, you should have the ``thirdai[neural_db]`` python package installed. + + Example: + .. code-block:: python + + from langchain_community.vectorstores import NeuralDBVectorStore + from thirdai import neural_db as ndb + + db = ndb.NeuralDB() + vectorstore = NeuralDBVectorStore(db=db) + """ + + def __init__(self, db): + self.db = db db: Any = None #: :meta private: """NeuralDB instance""" @@ -322,7 +337,6 @@ class NeuralDBVectorStore(VectorStore): metadata={ "id": ref.id, "upvote_ids": ref.upvote_ids, - "text": ref.text, "source": ref.source, "metadata": ref.metadata, "score": ref.score,