From 79b55eb969b4a54a5af8f4eab6e8be2cefb2f41a Mon Sep 17 00:00:00 2001 From: alperkaya Date: Thu, 19 Sep 2024 15:12:47 +0200 Subject: [PATCH] update order --- .../document_stores/chroma/document_store.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/integrations/chroma/src/haystack_integrations/document_stores/chroma/document_store.py b/integrations/chroma/src/haystack_integrations/document_stores/chroma/document_store.py index ae6bffb5f..4a2a1d8bc 100644 --- a/integrations/chroma/src/haystack_integrations/document_stores/chroma/document_store.py +++ b/integrations/chroma/src/haystack_integrations/document_stores/chroma/document_store.py @@ -76,11 +76,6 @@ def __init__( ) raise ValueError(error_message) - # Ensure only one of persist_path or host is provided - if persist_path and host: - error_message = "You cannot provide both `persist_path` and `host`. Please choose one." - raise ValueError(error_message) - # Store the params for marshalling self._collection_name = collection_name self._embedding_function = embedding_function @@ -88,6 +83,10 @@ def __init__( self._persist_path = persist_path self._distance_function = distance_function # Create the client instance + # Ensure only one of persist_path or host is provided + if persist_path and host: + error_message = "You cannot provide both `persist_path` and `host`. Please choose one." + raise ValueError(error_message) if host: # Remote connection via HTTP client self._chroma_client = chromadb.HttpClient(