Skip to content

Commit 742c385

Browse files
author
Daniel OBrien
committed
remove eronous print
fix access of class
1 parent d1257fc commit 742c385

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ldai/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def model_config(self, key: str, context: Context, default_value: AIConfig, vari
4343
if variables:
4444
all_variables.update(variables)
4545
all_variables['ldctx'] = context
46-
print(variation)
46+
4747
if isinstance(variation['prompt'], list) and all(isinstance(entry, dict) for entry in variation['prompt']):
4848
variation['prompt'] = [
4949
LDMessage(

ldai/tracker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ def track_bedrock_converse(self, res: dict) -> dict:
116116

117117
def track_tokens(self, tokens: Union[TokenUsage, BedrockTokenUsage]) -> None:
118118
token_metrics = tokens.to_metrics()
119-
if token_metrics['total'] > 0:
119+
if token_metrics.total > 0:
120120
self.ld_client.track('$ld:ai:tokens:total', self.context, self.get_track_data(), token_metrics.total)
121-
if token_metrics['input'] > 0:
121+
if token_metrics.input > 0:
122122
self.ld_client.track('$ld:ai:tokens:input', self.context, self.get_track_data(), token_metrics.input)
123-
if token_metrics['output'] > 0:
123+
if token_metrics.output > 0:
124124
self.ld_client.track('$ld:ai:tokens:output', self.context, self.get_track_data(), token_metrics.output)

0 commit comments

Comments
 (0)