Skip to content

Commit

Permalink
Set telemetry flag as a top level attribute (mem0ai#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev-Khant committed Sep 18, 2023
1 parent 3d0e414 commit d344ee2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions embedchain/embedchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ def __init__(
thread_telemetry = threading.Thread(target=self._send_telemetry_event, args=("init",))
thread_telemetry.start()

@property
def collect_metrics(self):
return self.config.collect_metrics

@collect_metrics.setter
def collect_metrics(self, value):
if not isinstance(value, bool):
raise ValueError(f"Boolean value expected but got {type(value)}.")
self.config.collect_metrics = value

def _load_or_generate_user_id(self) -> str:
"""
Loads the user id from the config file if it exists, otherwise generates a new
Expand Down

0 comments on commit d344ee2

Please sign in to comment.