Skip to content

Add gemini token counts #1377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 104 commits into
base: main
Choose a base branch
from
Draft

Add gemini token counts #1377

wants to merge 104 commits into from

Conversation

umaannamalai
Copy link
Contributor

This PR adds response.usage.completion_tokens, response.usage.prompt_tokens, response.usage.total_tokens attributes back into LLM events.

umaannamalai and others added 30 commits April 1, 2025 12:58
* Add Gemini test infra.

* Pull tox.ini changes.

* [MegaLinter] Apply linters fixes

* Remove mock package dependency.

* [MegaLinter] Apply linters fixes

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Add Gemini test infra.

* Pull tox.ini changes.

* [MegaLinter] Apply linters fixes

* Remove mock package dependency.

* [MegaLinter] Apply linters fixes

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…newrelic-python-agent into feature-gemini-instrumentation
@mergify mergify bot removed the merge-conflicts label Apr 30, 2025
Copy link

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 6 0 0 0.41s
✅ MARKDOWN markdownlint 7 0 0 0 0.98s
✅ MARKDOWN markdown-link-check 7 0 0 14.16s
❌ PYTHON ruff 908 1 1 0 0.6s
✅ PYTHON ruff-format 908 1 0 0 0.33s
✅ YAML prettier 13 0 0 0 1.23s
✅ YAML v8r 13 0 0 5.8s
✅ YAML yamllint 13 0 0 0.55s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 69.56522% with 14 lines in your changes missing coverage. Please review.

Please upload report for BASE (feature-gemini-instrumentation@bac3ede). Learn more about missing BASE report.

Files with missing lines Patch % Lines
newrelic/hooks/mlmodel_gemini.py 69.56% 9 Missing and 5 partials ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##             feature-gemini-instrumentation    #1377   +/-   ##
=================================================================
  Coverage                                  ?   81.30%           
=================================================================
  Files                                     ?      205           
  Lines                                     ?    23230           
  Branches                                  ?     3671           
=================================================================
  Hits                                      ?    18886           
  Misses                                    ?     3123           
  Partials                                  ?     1221           

☔ 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.

Base automatically changed from feature-gemini-instrumentation to main May 1, 2025 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants