Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Add Total Tokens to anthropic
Browse files Browse the repository at this point in the history
  • Loading branch information
patcher9 committed Mar 10, 2024
1 parent e6faac0 commit 32c1639
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dokumetry/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def stream_generator():
"finishReason": response.stop_reason,
"response": response.content[0].text
}
data["totalTokens"] = data["completionTokens"] + data["promptTokens"]

send_data(data, doku_url, api_key)

Expand Down
1 change: 1 addition & 0 deletions src/dokumetry/async_anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ async def stream_generator():
"finishReason": response.stop_reason,
"response": response.content[0].text
}
data["totalTokens"] = data["completionTokens"] + data["promptTokens"]

send_data(data, doku_url, api_key)

Expand Down

0 comments on commit 32c1639

Please sign in to comment.