Skip to content

Commit

Permalink
run black
Browse files Browse the repository at this point in the history
  • Loading branch information
ncybul committed Jan 24, 2025
1 parent a591f0d commit 52f0391
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ddtrace/llmobs/_integrations/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@ def get_llmobs_metrics_tags(integration_name, span):
return usage

# check for both prompt / completion or input / output tokens
input_tokens = span.get_metric("%s.response.usage.prompt_tokens" % integration_name) or span.get_metric("%s.response.usage.input_tokens" % integration_name)
output_tokens = span.get_metric("%s.response.usage.completion_tokens" % integration_name) or span.get_metric("%s.response.usage.output_tokens" % integration_name)
input_tokens = span.get_metric("%s.response.usage.prompt_tokens" % integration_name) or span.get_metric(
"%s.response.usage.input_tokens" % integration_name
)
output_tokens = span.get_metric("%s.response.usage.completion_tokens" % integration_name) or span.get_metric(
"%s.response.usage.output_tokens" % integration_name
)
total_tokens = span.get_metric("%s.response.usage.total_tokens" % integration_name)

if input_tokens is not None:
Expand Down

0 comments on commit 52f0391

Please sign in to comment.