Merge pull request #25 from zhangw/chroma-telemetry-disable

disable the posthog telemetry mechnism that may raise the connection error
This commit is contained in:
lightislost 2024-03-01 14:07:44 +08:00 committed by GitHub
commit c14b41ecec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -16,7 +16,11 @@ class ChromaHandler:
@param path: path of data @param path: path of data
@collection_name: name of collection @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() self.client.heartbeat()
if collection_name: if collection_name: