Skip to content

Conversation

@dot-agi
Copy link
Member

@dot-agi dot-agi commented May 6, 2025

Changelog

Closes #107 #106 #93 #81 #74

  • New refresh_prices method that uses update_token_costs and optionally writes to model_prices.json
  • Updated the update_prices.py script to use this method
  • Removed all files and code related to llama-index

@dot-agi dot-agi requested review from areibman and Copilot May 6, 2025 22:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new synchronous refresh_prices method for updating token prices and removes deprecated llama-index-related code. Key changes include:

  • Adding a new refresh_prices method in tokencost/constants.py that wraps the asynchronous update_token_costs call.
  • Updating update_prices.py to use the new refresh_prices method and improving output messages.
  • Removing llama-index callback support along with associated tests and dependency references.

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
update_prices.py Uses refresh_prices and refactors file update logic.
tokencost/constants.py Adds refresh_prices synchronous wrapper.
tokencost/callbacks/llama_index.py Removes deprecated llama-index callback handler.
tokencost/init.py Updates module exports to include refresh_prices.
tests/test_llama_index_callbacks.py Removes tests for removed llama-index code.
tach.yml Removes dependency on llama-index callbacks.
pyproject.toml Updates version, Python requirement, and team members.
Files not reviewed (1)
  • tox.ini: Language not supported

@dot-agi dot-agi requested a review from Copilot May 6, 2025 22:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new synchronous method, refresh_prices, for updating token costs and refactors the update_prices workflow to utilize it while removing deprecated llama-index code.

  • Added refresh_prices as a synchronous wrapper for update_token_costs that optionally writes to model_prices.json
  • Updated update_prices.py to call refresh_prices and adjusted file update logic and formatting
  • Removed all llama-index related code and tests; version and dependency updates in pyproject.toml

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
update_prices.py Uses refresh_prices for fetching token prices and updates the file
tokencost/constants.py Adds refresh_prices; provides synchronous wrapper for token update
tokencost/callbacks/llama_index.py Removed deprecated llama-index callback handler
tokencost/init.py Updated import to include refresh_prices
tests/test_llama_index_callbacks.py Removed test file for llama-index callbacks
tach.yml Removed dependency on llama-index callbacks
pyproject.toml Bumped version, updated authors, and removed llama-index dependency
Files not reviewed (1)
  • tox.ini: Language not supported

@dot-agi dot-agi requested a review from Copilot May 6, 2025 23:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new synchronous method, refresh_prices, to fetch and update token costs and updates update_prices.py to use it while removing deprecated llama-index code.

  • Added refresh_prices in tokencost/constants.py to synchronously wrap update_token_costs.
  • Updated update_prices.py to leverage refresh_prices and improved log messages.
  • Removed deprecated llama-index callbacks and tests, and updated project configuration (version and Python requirement).

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
update_prices.py Uses refresh_prices and improves diff_dicts and logging behavior
tokencost/constants.py Introduces refresh_prices synchronous method and updates error handling
tokencost/callbacks/llama_index.py Removes obsolete llama-index callback code
tokencost/init.py Exposes refresh_prices in the public API
tests/test_llama_index_callbacks.py Removes tests for the deprecated llama-index callbacks
tach.yml Removes dependency on the llama-index callbacks module
pyproject.toml Bumps version to 0.2.0 and updates the Python requirement
Files not reviewed (1)
  • tox.ini: Language not supported

@dot-agi dot-agi force-pushed the feat/new-prices-fetch branch from 379aa2a to 17b3c5e Compare May 7, 2025 00:11
@dot-agi dot-agi merged commit 6208796 into main May 7, 2025
2 checks passed
@dot-agi dot-agi deleted the feat/new-prices-fetch branch May 11, 2025 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants