disable posthog telemetry for chromadb

This commit is contained in:
vincent 2024-02-29 00:37:05 +08:00
parent 66d029d276
commit 7b2e1b0c5a
1 changed files with 5 additions and 1 deletions

View File

@ -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: