feat: anonymous telemetry (#423)

This commit is contained in:
cachho
2023-08-12 01:27:11 +02:00
committed by GitHub
parent 1e0d967bb5
commit 163f437582
12 changed files with 126 additions and 38 deletions

View File

@@ -1,4 +1,5 @@
import os
from typing import Optional
try:
from chromadb.utils import embedding_functions
@@ -16,7 +17,15 @@ class AppConfig(BaseAppConfig):
Config to initialize an embedchain custom `App` instance, with extra config options.
"""
def __init__(self, log_level=None, host=None, port=None, id=None, collection_name=None):
def __init__(
self,
log_level=None,
host=None,
port=None,
id=None,
collection_name=None,
collect_metrics: Optional[bool] = None,
):
"""
:param log_level: Optional. (String) Debug level
['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'].
@@ -24,6 +33,7 @@ class AppConfig(BaseAppConfig):
:param port: Optional. Port for the database server.
:param id: Optional. ID of the app. Document metadata will have this id.
:param collection_name: Optional. Collection name for the database.
:param collect_metrics: Defaults to True. Send anonymous telemetry to improve embedchain.
"""
super().__init__(
log_level=log_level,
@@ -32,6 +42,7 @@ class AppConfig(BaseAppConfig):
port=port,
id=id,
collection_name=collection_name,
collect_metrics=collect_metrics,
)
@staticmethod