From 8ba492ed6a5092fced0397705b52968c4c368456 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Fri, 24 May 2024 23:00:22 +0530 Subject: [PATCH] community[minor]: clickhouse -- ability to use secure connection (#22108) - **Description:** this PR gives clickhouse client the ability to use a secure connection to the clickhosue server - **Issue:** fixes #22082 - **Dependencies:** - - **Twitter handle:** `_codingcoffee_` Signed-off-by: Ameya Shenoy Co-authored-by: Shresth Rana --- libs/community/langchain_community/vectorstores/clickhouse.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/community/langchain_community/vectorstores/clickhouse.py b/libs/community/langchain_community/vectorstores/clickhouse.py index e2083deb47e..d950a541be8 100644 --- a/libs/community/langchain_community/vectorstores/clickhouse.py +++ b/libs/community/langchain_community/vectorstores/clickhouse.py @@ -39,6 +39,7 @@ class ClickhouseSettings(BaseSettings): port (int) : URL port to connect with HTTP. Defaults to 8443. username (str) : Username to login. Defaults to None. password (str) : Password to login. Defaults to None. + secure (bool) : Connect to server over secure connection. Defaults to False. index_type (str): index type string. index_param (list): index build parameter. index_query_params(dict): index query parameters. @@ -72,6 +73,8 @@ class ClickhouseSettings(BaseSettings): username: Optional[str] = None password: Optional[str] = None + secure: bool = False + index_type: Optional[str] = "annoy" # Annoy supports L2Distance and cosineDistance. index_param: Optional[Union[List, Dict]] = ["'L2Distance'", 100] @@ -193,6 +196,7 @@ class Clickhouse(VectorStore): port=self.config.port, username=self.config.username, password=self.config.password, + secure=self.config.secure, **kwargs, ) # Enable JSON type