Skip to content

Conversation

umaannamalai
Copy link
Contributor

This PR updates OpenAI instrumentation and tests to pull token counts directly from the response object. If a customer has an LLM token counting callback function registered, this will still take priority over the response token count values.

It also removes token count calculations from error cases as the agent will consistently stop reporting token counts when a error was met during the creation of an embedding or chat completion.

Copy link

github-actions bot commented Sep 16, 2025

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 6 0 0 0.85s
✅ MARKDOWN markdownlint 7 0 0 0 1.24s
✅ MARKDOWN markdown-link-check 7 0 0 21.82s
✅ PYTHON ruff 940 2 0 0 0.97s
✅ PYTHON ruff-format 940 3 0 0 0.33s
✅ YAML prettier 13 0 0 0 1.4s
✅ YAML v8r 13 0 0 5.42s
✅ YAML yamllint 13 0 0 0.6s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@mergify mergify bot added the tests-failing Tests failing in CI. label Sep 16, 2025
@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.46%. Comparing base (b1408de) to head (8a44e9a).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           feature-llm-token-counts    #1498      +/-   ##
============================================================
- Coverage                     81.48%   81.46%   -0.03%     
============================================================
  Files                           209      209              
  Lines                         23815    23841      +26     
  Branches                       3753     3757       +4     
============================================================
+ Hits                          19406    19422      +16     
- Misses                         3153     3159       +6     
- Partials                       1256     1260       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mergify mergify bot removed the tests-failing Tests failing in CI. label Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants