Skip to content

Commit

Permalink
qdrant[patch]: Make path optional in from_existing_collection() (lang…
Browse files Browse the repository at this point in the history
…chain-ai#21875)

## Description

The `path` param is used to specify the local persistence directory,
which isn't required if using Qdrant server.

This is a breaking but necessary change.
  • Loading branch information
Anush008 authored and JonZeolla committed Jun 11, 2024
1 parent 4aabc64 commit 689ba64
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libs/partners/qdrant/langchain_qdrant/vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -1353,8 +1353,8 @@ def from_texts(
def from_existing_collection(
cls: Type[Qdrant],
embedding: Embeddings,
path: str,
collection_name: str,
path: Optional[str] = None,
collection_name: Optional[str] = None,
location: Optional[str] = None,
url: Optional[str] = None,
port: Optional[int] = 6333,
Expand All @@ -1376,6 +1376,10 @@ def from_existing_collection(
This method will return the instance of the store without inserting any new
embeddings
"""

if collection_name is None:
raise ValueError("Must specify collection_name. Received None.")

client, async_client = cls._generate_clients(
location=location,
url=url,
Expand Down

0 comments on commit 689ba64

Please sign in to comment.