Skip to content

Commit

Permalink
feat: Add force_disable_check_same_thread init param for Qdrant local…
Browse files Browse the repository at this point in the history
… client (#779)

* fix: added missing init param which is use by qdrant local client

* fix: Corrected linting
  • Loading branch information
lohit8846 authored Jun 6, 2024
1 parent 3f3fa2b commit 78157a9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def __init__(
timeout: Optional[int] = None,
host: Optional[str] = None,
path: Optional[str] = None,
force_disable_check_same_thread: bool = False,
index: str = "Document",
embedding_dim: int = 768,
on_disk: bool = False,
Expand Down Expand Up @@ -109,6 +110,7 @@ def __init__(
self.timeout = timeout
self.host = host
self.path = path
self.force_disable_check_same_thread = force_disable_check_same_thread
self.metadata = metadata or {}
self.api_key = api_key

Expand Down Expand Up @@ -155,6 +157,7 @@ def client(self):
host=self.host,
path=self.path,
metadata=self.metadata,
force_disable_check_same_thread=self.force_disable_check_same_thread,
)
# Make sure the collection is properly set up
self._set_up_collection(
Expand Down
3 changes: 3 additions & 0 deletions integrations/qdrant/tests/test_dict_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def test_to_dict():
"content_field": "content",
"name_field": "name",
"embedding_field": "embedding",
"force_disable_check_same_thread": False,
"use_sparse_embeddings": False,
"similarity": "cosine",
"return_embedding": False,
Expand Down Expand Up @@ -64,6 +65,7 @@ def test_from_dict():
"content_field": "content",
"name_field": "name",
"embedding_field": "embedding",
"force_disable_check_same_thread": False,
"use_sparse_embeddings": True,
"similarity": "cosine",
"return_embedding": False,
Expand All @@ -88,6 +90,7 @@ def test_from_dict():
document_store.content_field == "content",
document_store.name_field == "name",
document_store.embedding_field == "embedding",
document_store.force_disable_check_same_thread is False,
document_store.use_sparse_embeddings is True,
document_store.on_disk is False,
document_store.similarity == "cosine",
Expand Down
3 changes: 3 additions & 0 deletions integrations/qdrant/tests/test_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def test_to_dict(self):
"on_disk": False,
"content_field": "content",
"name_field": "name",
"force_disable_check_same_thread": False,
"embedding_field": "embedding",
"use_sparse_embeddings": False,
"similarity": "cosine",
Expand Down Expand Up @@ -172,6 +173,7 @@ def test_to_dict(self):
"content_field": "content",
"name_field": "name",
"embedding_field": "embedding",
"force_disable_check_same_thread": False,
"use_sparse_embeddings": False,
"similarity": "cosine",
"return_embedding": False,
Expand Down Expand Up @@ -281,6 +283,7 @@ def test_to_dict(self):
"content_field": "content",
"name_field": "name",
"embedding_field": "embedding",
"force_disable_check_same_thread": False,
"use_sparse_embeddings": False,
"similarity": "cosine",
"return_embedding": False,
Expand Down

0 comments on commit 78157a9

Please sign in to comment.