🐛 fix(loading.py): fix issue with search_kwargs assignment in instantiate_vectorstore function

🔧 chore(loading.py): refactor instantiate_vectorstore function to clean up docs or texts to have only documents
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-10-30 20:32:48 -03:00
commit c49d0c7faf

View file

@ -300,6 +300,8 @@ def instantiate_embedding(node_type, class_object, params: Dict):
def instantiate_vectorstore(class_object: Type[VectorStore], params: Dict):
search_kwargs = params.pop("search_kwargs", {})
if search_kwargs == {"yourkey": "value"}:
search_kwargs = {}
# clean up docs or texts to have only documents
if "texts" in params:
params["documents"] = params.pop("texts")