From 7b2e1b0c5abd30cf1eceb32311585415333c0607 Mon Sep 17 00:00:00 2001 From: vincent Date: Thu, 29 Feb 2024 00:37:05 +0800 Subject: [PATCH] disable posthog telemetry for chromadb --- coagent/db_handler/vector_db_handler/chroma_handler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coagent/db_handler/vector_db_handler/chroma_handler.py b/coagent/db_handler/vector_db_handler/chroma_handler.py index 07822e1..f86141c 100644 --- a/coagent/db_handler/vector_db_handler/chroma_handler.py +++ b/coagent/db_handler/vector_db_handler/chroma_handler.py @@ -16,7 +16,11 @@ class ChromaHandler: @param path: path of data @collection_name: name of collection ''' - self.client = chromadb.PersistentClient(path) + settings = chromadb.get_settings() + # disable the posthog telemetry mechnism that may raise the connection error, such as + # "requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='us-api.i.posthog.com', port 443)" + settings.anonymized_telemetry = False + self.client = chromadb.PersistentClient(path, settings) self.client.heartbeat() if collection_name: