Skip to content

Conversation

@DellaBitta
Copy link
Contributor

@DellaBitta DellaBitta commented Dec 1, 2025

Discussion

We had some "ballpark" checks for the number of tokens returned in responses.

However, the number of tokens returned had a high variance based on general AI chaos and the model that was used. This PR replaces somewhat exacting token count checks with simple non-zero checks in order to reduce flake.

Additionally, the change removes toolUsePromptTokenCount checks for the gemini-2.0-flash model, which doesn't support this field.

Testing

This change updates the tests themselves. Tested locally.

API Changes

N/A.

@changeset-bot
Copy link

changeset-bot bot commented Dec 1, 2025

⚠️ No Changeset found

Latest commit: 686c3e2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 1, 2025

@DellaBitta DellaBitta marked this pull request as ready for review December 1, 2025 19:58
@DellaBitta DellaBitta requested a review from a team as a code owner December 1, 2025 19:58
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 1, 2025

Size Analysis Report 1

Affected Products

No changes between base commit (e6415dd) and merge commit (0f50db2).

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/aVmZGXjlIv.html

@DellaBitta DellaBitta merged commit f5fc6bf into main Dec 1, 2025
38 checks passed
@DellaBitta DellaBitta deleted the ddb-ai-count-tokens branch December 1, 2025 20:35
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