Skip to content

Commit ed02047

Browse files
authored
fix: Remove deprecated track generation event (#57)
1 parent df8cc20 commit ed02047

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

ldai/testing/test_tracker.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,6 @@ def test_tracks_bedrock_metrics(client: LDClient):
176176
tracker.track_bedrock_converse_metrics(bedrock_result)
177177

178178
calls = [
179-
call(
180-
"$ld:ai:generation",
181-
context,
182-
{"variationKey": "variation-key", "configKey": "config-key", "version": 3},
183-
1,
184-
),
185179
call(
186180
"$ld:ai:generation:success",
187181
context,
@@ -239,12 +233,6 @@ def test_tracks_bedrock_metrics_with_error(client: LDClient):
239233
tracker.track_bedrock_converse_metrics(bedrock_result)
240234

241235
calls = [
242-
call(
243-
"$ld:ai:generation",
244-
context,
245-
{"variationKey": "variation-key", "configKey": "config-key", "version": 3},
246-
1,
247-
),
248236
call(
249237
"$ld:ai:generation:error",
250238
context,
@@ -303,12 +291,6 @@ def to_dict(self):
303291
tracker.track_openai_metrics(lambda: Result())
304292

305293
calls = [
306-
call(
307-
"$ld:ai:generation",
308-
context,
309-
{"variationKey": "variation-key", "configKey": "config-key", "version": 3},
310-
1,
311-
),
312294
call(
313295
"$ld:ai:generation:success",
314296
context,
@@ -354,12 +336,6 @@ def raise_exception():
354336
pass
355337

356338
calls = [
357-
call(
358-
"$ld:ai:generation",
359-
context,
360-
{"variationKey": "variation-key", "configKey": "config-key", "version": 3},
361-
1,
362-
),
363339
call(
364340
"$ld:ai:generation:error",
365341
context,
@@ -401,12 +377,6 @@ def test_tracks_success(client: LDClient):
401377
tracker.track_success()
402378

403379
calls = [
404-
call(
405-
"$ld:ai:generation",
406-
context,
407-
{"variationKey": "variation-key", "configKey": "config-key", "version": 3},
408-
1,
409-
),
410380
call(
411381
"$ld:ai:generation:success",
412382
context,
@@ -426,12 +396,6 @@ def test_tracks_error(client: LDClient):
426396
tracker.track_error()
427397

428398
calls = [
429-
call(
430-
"$ld:ai:generation",
431-
context,
432-
{"variationKey": "variation-key", "configKey": "config-key", "version": 3},
433-
1,
434-
),
435399
call(
436400
"$ld:ai:generation:error",
437401
context,
@@ -452,24 +416,12 @@ def test_error_overwrites_success(client: LDClient):
452416
tracker.track_error()
453417

454418
calls = [
455-
call(
456-
"$ld:ai:generation",
457-
context,
458-
{"variationKey": "variation-key", "configKey": "config-key", "version": 3},
459-
1,
460-
),
461419
call(
462420
"$ld:ai:generation:success",
463421
context,
464422
{"variationKey": "variation-key", "configKey": "config-key", "version": 3},
465423
1,
466424
),
467-
call(
468-
"$ld:ai:generation",
469-
context,
470-
{"variationKey": "variation-key", "configKey": "config-key", "version": 3},
471-
1,
472-
),
473425
call(
474426
"$ld:ai:generation:error",
475427
context,

ldai/tracker.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,6 @@ def track_success(self) -> None:
176176
Track a successful AI generation.
177177
"""
178178
self._summary._success = True
179-
self._ld_client.track(
180-
"$ld:ai:generation", self._context, self.__get_track_data(), 1
181-
)
182179
self._ld_client.track(
183180
"$ld:ai:generation:success", self._context, self.__get_track_data(), 1
184181
)
@@ -188,9 +185,6 @@ def track_error(self) -> None:
188185
Track an unsuccessful AI generation attempt.
189186
"""
190187
self._summary._success = False
191-
self._ld_client.track(
192-
"$ld:ai:generation", self._context, self.__get_track_data(), 1
193-
)
194188
self._ld_client.track(
195189
"$ld:ai:generation:error", self._context, self.__get_track_data(), 1
196190
)

0 commit comments

Comments
 (0)