Skip to content

Commit

Permalink
Change to keep original usage metadata
Browse files Browse the repository at this point in the history
Don't overwrite usage, change to keep original usage metadata.
  • Loading branch information
hirune924 authored Jan 17, 2025
1 parent 3267c06 commit 8ecee8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ell/providers/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def translate_from_provider(
usage["completion_tokens"] = usage.get("output_tokens", 0)
usage["total_tokens"] = usage['prompt_tokens'] + usage['completion_tokens']

metadata["usage"] = usage
metadata["usage"] = {**usage, **metadata.get("usage", {})}
return tracked_results, metadata

# XXX: Make a singleton.
Expand Down

0 comments on commit 8ecee8b

Please sign in to comment.