Skip to content

[langchain] token counts missing for gemini + langchain #1391

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

Closed
mikeldking opened this issue Mar 19, 2025 · 4 comments
Closed

[langchain] token counts missing for gemini + langchain #1391

mikeldking opened this issue Mar 19, 2025 · 4 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed language: python Related to Python integration

Comments

@mikeldking
Copy link
Contributor

see https://arize-ai.slack.com/archives/C04R3GXC8HK/p1742373744925739

We might not be looking at the right place for token counts.

@mikeldking mikeldking added help wanted Extra attention is needed language: python Related to Python integration labels Mar 19, 2025
@dosubot dosubot bot added the bug Something isn't working label Mar 19, 2025
@satya-turing
Copy link
Collaborator

@mikeldking Can you add more context on this ticket? so that I can take up.

@mikeldking
Copy link
Contributor Author

Hey @satya-turing - I think the first step is to get a small example with gemini + langchain up in say the examples directory.

After that test different types of generation (chat complete, stream, etc.). You will probably find that the token details are somewhere in the langchain run kwargs or extras. Parse those into our conventions!

@Jgilhuly Jgilhuly assigned satya-turing and unassigned Jgilhuly Mar 28, 2025
@Jgilhuly
Copy link
Contributor

Jgilhuly commented Apr 1, 2025

Based on Satya's testing, we do collect token counts using the gemini+langchain combo currently. Here's an example: #1456

@mikeldking - lmk if we can close this out

@satya-turing
Copy link
Collaborator

Closing this issue due to no updates over the past few weeks.
If you experience any further problems or have additional questions, please feel free to reopen the ticket. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed language: python Related to Python integration
Projects
Status: Done
Development

No branches or pull requests

3 participants