-
Notifications
You must be signed in to change notification settings - Fork 693
prompt_tokens support in message [anthropic vertex ai] #1187
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
prompt_tokens support in message [anthropic vertex ai] #1187
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds support for prompt_tokens in the Google Vertex AI provider, which is a good enhancement for tracking token usage. I've identified a few minor improvements that could make the implementation more robust.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty good for a bot tbh
Important PR Review SkippedPR review skipped as per the configuration setting. Run a manually review by commenting /matter review 💡Tips to use Matter AICommand List
|
Description
This PR improves token usage tracking in Google Vertex AI streaming responses by storing prompt token information in the stream state and including token usage metrics in response chunks
Motivation
The current implementation doesn't properly maintain token usage information across streaming chunks, which leads missing token metrics in the chunk response. This change ensures that prompt tokens are properly stored in the stream state and that total token counts are accurately calculated and included in the response
Type of Change
How Has This Been Tested?
Screenshots (if applicable)
Checklist
Related Issues
Before vs after