Skip to content

Commit

Permalink
update version + fix cost updater
Browse files Browse the repository at this point in the history
  • Loading branch information
areibman committed Oct 27, 2024
1 parent 76d5a6e commit cd7ee73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tokencost = ["model_prices.json"]

[project]
name = "tokencost"
version = "0.1.14"
version = "0.1.15"
authors = [
{ name = "Trisha Pan", email = "trishaepan@gmail.com" },
{ name = "Alex Reibman", email = "areibman@gmail.com" },
Expand Down
3 changes: 2 additions & 1 deletion tokencost/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ async def update_token_costs():
"""Update the TOKEN_COSTS dictionary with the latest costs from the LiteLLM cost tracker asynchronously."""
global TOKEN_COSTS
try:
TOKEN_COSTS = await fetch_costs()
fetched_costs = await fetch_costs()
TOKEN_COSTS.update(fetched_costs)
# Safely remove 'sample_spec' if it exists
TOKEN_COSTS.pop('sample_spec', None)
except Exception as e:
Expand Down

0 comments on commit cd7ee73

Please sign in to comment.