mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-10-30 01:09:43 +00:00
chore: de-couple the telemetry events for each tutorial from the dataset on AWS that is used (#4155)
* removing old dataset telemetry events * changing function name * adding the datasets back for old tutorials * fixing mini bug * resolving cometns * quick bug fix * re-adding docstrings * removing unnecessay import * re-adding the telemetry event call for datasets --------- Co-authored-by: Massimiliano Pippi <mpippi@gmail.com>
This commit is contained in:
parent
e7bb2487eb
commit
8370715e7c
@ -185,7 +185,6 @@ def send_custom_event(event: str = "", payload: Optional[Dict[str, Any]] = None)
|
||||
def send_tutorial_event(url: str):
|
||||
"""
|
||||
Can be called when a tutorial dataset is downloaded so that the dataset URL is used to identify the tutorial and send an event.
|
||||
|
||||
:param url: URL of the dataset that is loaded in the tutorial.
|
||||
"""
|
||||
dataset_url_to_tutorial = {
|
||||
@ -213,6 +212,14 @@ def send_tutorial_event(url: str):
|
||||
send_custom_event(event=f"tutorial {dataset_url_to_tutorial.get(url, '?')} executed")
|
||||
|
||||
|
||||
def tutorial_running(tutorial_id: int):
|
||||
"""
|
||||
Can be called when a tutorial is executed so that the tutorial_id is used to identify the tutorial and send an event.
|
||||
:param tutorial_id: ID number of the tutorial
|
||||
"""
|
||||
send_custom_event(event=f"tutorial {tutorial_id} executed")
|
||||
|
||||
|
||||
def _get_or_create_user_id() -> Optional[str]:
|
||||
"""
|
||||
Randomly generates a user id or loads the id defined in the config file and returns it.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user