Skip to content

Commit

Permalink
fix bedrock
Browse files Browse the repository at this point in the history
  • Loading branch information
MadcowD committed Oct 3, 2024
1 parent 9cf8635 commit a6100a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ell/providers/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
from PIL import Image as PILImage

try:
from botocore.client import BaseClient

from botocore.eventstream import (EventStream)
from botocore.client import BaseClient

class BedrockProvider(Provider):
dangerous_disable_validation = True

Expand Down Expand Up @@ -153,6 +155,7 @@ def translate_from_provider(

# process metadata for ell
# XXX: Unify an ell metadata format for ell studio.
usage = {} if not usage else usage
usage["prompt_tokens"] = usage.get("inputTokens", 0)
usage["completion_tokens"] = usage.get("outputTokens", 0)
usage["total_tokens"] = usage['prompt_tokens'] + usage['completion_tokens']
Expand Down

0 comments on commit a6100a7

Please sign in to comment.