Skip to content

Commit 48a97b4

Browse files
committed
removed unneeded function and fixed lint errors
1 parent 88f5e79 commit 48a97b4

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

ldai/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def agents(
346346
for config in agent_configs:
347347
# Ensure default_value is set (should be handled by __post_init__, but satisfy type checker)
348348
default_value = config.default_value or LDAIAgentDefaults(enabled=False)
349-
349+
350350
agent = self.__evaluate_agent(
351351
config.key,
352352
context,

ldai/testing/test_agents.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -327,12 +327,6 @@ def test_agent_tracker_functionality(ldai_client: LDAIClient):
327327
assert hasattr(agent.tracker, 'track_duration')
328328
assert hasattr(agent.tracker, 'track_tokens')
329329

330-
# Test that tracker has correct metadata
331-
track_data = agent.tracker.get_track_data()
332-
assert track_data['variationKey'] == 'agent-v1'
333-
assert track_data['configKey'] == 'customer-support-agent'
334-
assert track_data['version'] == 1
335-
336330

337331
def test_agent_tracking_calls(ldai_client: LDAIClient):
338332
"""Test that tracking calls are made for agent usage."""
@@ -423,7 +417,7 @@ def test_agent_config_dataclass():
423417
def test_agent_config_optional_default_value():
424418
"""Test that LDAIAgentConfig defaults to {enabled: False} when default_value is not provided."""
425419
config = LDAIAgentConfig(key='test-agent')
426-
420+
427421
assert config.key == 'test-agent'
428422
assert config.default_value is not None
429423
assert config.default_value.enabled is False
@@ -433,10 +427,10 @@ def test_agent_config_optional_default_value():
433427
def test_single_agent_optional_default_value(ldai_client: LDAIClient):
434428
"""Test the single agent() method with optional default_value."""
435429
context = Context.create('user-key')
436-
430+
437431
# Should work with no default_value provided (defaults to {enabled: False})
438432
agent = ldai_client.agent('non-existent-agent', context)
439-
433+
440434
assert agent.enabled is False # Should default to False
441435
assert agent.tracker is not None
442436

@@ -456,11 +450,11 @@ def test_agents_method_with_optional_defaults(ldai_client: LDAIClient):
456450
agents = ldai_client.agents(agent_configs, context)
457451

458452
assert len(agents) == 2
459-
453+
460454
# First agent should use default {enabled: False} from auto-generated default_value
461455
support_agent = agents['customer-support-agent']
462456
assert support_agent.enabled is True # From flag configuration
463-
457+
464458
# Second agent should use custom default
465459
sales_agent = agents['sales-assistant']
466460
assert sales_agent.enabled is True

ldai/tracker.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,6 @@ def get_summary(self) -> LDAIMetricSummary:
282282
"""
283283
return self._summary
284284

285-
def get_track_data(self) -> Dict[str, Any]:
286-
"""
287-
Get tracking data for events.
288-
289-
:return: Dictionary containing variation and config keys.
290-
"""
291-
return self.__get_track_data()
292-
293285

294286
def _bedrock_to_token_usage(data: dict) -> TokenUsage:
295287
"""

0 commit comments

Comments
 (0)