community[patch]: docarray requires hnsw installation (#19416)

I have a small dataset, and I tried to use docarray:
``DocArrayHnswSearch ``. But when I execute, it returns:

```bash
    raise ImportError(
ImportError: Could not import docarray python package. Please install it with `pip install "langchain[docarray]"`.
```

Instead of docarray it needs to be 

```bash
docarray[hnswlib]
```

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
This commit is contained in:
Tarun Jain 2024-03-23 04:09:07 +05:30 committed by GitHub
parent d4dc98a9f9
commit ef6d3d66d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,7 +14,7 @@ class DocArrayHnswSearch(DocArrayIndex):
"""`HnswLib` storage using `DocArray` package. """`HnswLib` storage using `DocArray` package.
To use it, you should have the ``docarray`` package with version >=0.32.0 installed. To use it, you should have the ``docarray`` package with version >=0.32.0 installed.
You can install it with `pip install "langchain[docarray]"`. You can install it with `pip install "docarray[hnswlib]"`.
""" """
@classmethod @classmethod