Skip to content

Commit cd7ee73

Browse files
committed
update version + fix cost updater
1 parent 76d5a6e commit cd7ee73

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tokencost = ["model_prices.json"]
1010

1111
[project]
1212
name = "tokencost"
13-
version = "0.1.14"
13+
version = "0.1.15"
1414
authors = [
1515
{ name = "Trisha Pan", email = "trishaepan@gmail.com" },
1616
{ name = "Alex Reibman", email = "areibman@gmail.com" },

tokencost/constants.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ async def update_token_costs():
4646
"""Update the TOKEN_COSTS dictionary with the latest costs from the LiteLLM cost tracker asynchronously."""
4747
global TOKEN_COSTS
4848
try:
49-
TOKEN_COSTS = await fetch_costs()
49+
fetched_costs = await fetch_costs()
50+
TOKEN_COSTS.update(fetched_costs)
5051
# Safely remove 'sample_spec' if it exists
5152
TOKEN_COSTS.pop('sample_spec', None)
5253
except Exception as e:

0 commit comments

Comments
 (0)