diff --git a/pyproject.toml b/pyproject.toml index 7863094..1a61798 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" }, diff --git a/tokencost/constants.py b/tokencost/constants.py index 31daf7b..083ed9d 100644 --- a/tokencost/constants.py +++ b/tokencost/constants.py @@ -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: