Added docs for skip_embedding and embeddings argument of vectordbs (#784)

This commit is contained in:
Rupesh Bansal
2023-10-10 00:31:44 +05:30
committed by GitHub
parent 702067e521
commit bc649b9a85
3 changed files with 18 additions and 6 deletions

View File

@@ -110,12 +110,12 @@ class OpenSearchDB(BaseVectorDB):
return result
def add(
self, embeddings: List[str], documents: List[str], metadatas: List[object], ids: List[str], skip_embedding: bool
):
self, embeddings: List[List[str]], documents: List[str], metadatas: List[object], ids: List[str],
skip_embedding: bool):
"""add data in vector database
:param embeddings: list of embeddings to add
:type embeddings: List[str]
:type embeddings: List[List[str]]
:param documents: list of texts to add
:type documents: List[str]
:param metadatas: list of metadata associated with docs
@@ -127,8 +127,8 @@ class OpenSearchDB(BaseVectorDB):
"""
docs = []
# TODO(rupeshbansal, deshraj): Add support for skip embeddings here if already exists
embeddings = self.embedder.embedding_fn(documents)
if not skip_embedding:
embeddings = self.embedder.embedding_fn(documents)
for id, text, metadata, embeddings in zip(ids, documents, metadatas, embeddings):
docs.append(
{