Skip to content
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

genai: fix usage metadata #545

Merged
merged 3 commits into from
Oct 11, 2024
Merged

genai: fix usage metadata #545

merged 3 commits into from
Oct 11, 2024

Conversation

efriis
Copy link
Member

@efriis efriis commented Oct 8, 2024

fixes #491

tested by langchain-ai/langchain#27177

waiting on core release with usage metadata utils

@lkuligin lkuligin merged commit 1012abe into main Oct 11, 2024
15 checks passed
@lkuligin lkuligin deleted the erick/genai-fix-usage-metadata branch October 11, 2024 17:03
@boriswang01
Copy link

@lkuligin @efriis Hey I update to the latest package of langchain_google_genai (2.0.1) and I am still getting the same issue with input token count:

google token count test.txt

"""
usage_metadata: {'input_tokens': 1056, 'output_tokens': 672, 'total_tokens': 1728}

Usage Data:
Input Tokens: 65
Output Tokens: 672
Total Tokens: 737
"""

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.

Input/output token count returned by Langchain-Google seem excessively high
3 participants