Skip to content

Commit

Permalink
fix token counter (#9744)
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-markewich authored Dec 29, 2023
1 parent deced4b commit fffcd15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llama_index/callbacks/token_counting.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_llm_token_counts(
response_tokens = 0

if response is not None and response.raw is not None:
usage = response.raw.get("usage") # type: ignore
usage = dict(response.raw.get("usage")) # type: ignore

if usage is not None:
messages_tokens = usage.get("prompt_tokens", 0)
Expand Down

0 comments on commit fffcd15

Please sign in to comment.