mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-10-26 23:38:58 +00:00
feat: add _get_telemetry_data to GPTGenerator (#5958)
* add telemetry to pipelines 2.0 * only collect data if telemetry is on * reno * add downsampling * typing * manual tests * pylint * simplify code * Update haystack/preview/telemetry/__init__.py * look for _telemetry_data * rather index by component type * black * mypy * error handling * comment * add telemetry_data to gptgenerator * review feedback & small improvements * defaultdict * stray changes * try-catch * method instead of attribute * change attribute to method * fixes * remove print statements * lint * invert condition * always send the first event of the day * collect specs * track 2nd and 3rd events too * send first event and then max 1 event a minute * rename constant * black
This commit is contained in:
parent
660f84e6ef
commit
490de4e119
@ -91,6 +91,12 @@ class GPTGenerator:
|
||||
self.streaming_callback = streaming_callback
|
||||
self.api_base_url = api_base_url
|
||||
|
||||
def _get_telemetry_data(self) -> Dict[str, Any]:
|
||||
"""
|
||||
Data that is sent to Posthog for usage analytics.
|
||||
"""
|
||||
return {"model": self.model_name}
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""
|
||||
Serialize this component to a dictionary.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user