Add support for token-based usage metrics. #8757
Conversation
Token measurement is broken down by modaliy, with separate counters for image, audio, etc. Tests are in version 6.*, so this change also includes bumping update_responses.sh
🦋 Changeset detectedLatest commit: 6f90b2e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
hsubox76
left a comment
There was a problem hiding this comment.
Looks good, just need to add a changeset - yarn changeset, choose "@firebase/vertexai" (should already be selected) and "firebase" (won't be selected) and select "minor" for both. If you can't select "firebase" that's ok, you can also add 'firebase': minor manually in the resulting changeset file after it's created.
| */ | ||
| totalBillableCharacters?: number; | ||
|
|
||
| promptTokensDetails?: ModalityTokenCount[]; |
There was a problem hiding this comment.
Do we want docs on this property? If so, add it in the same comment format as the two other properties above.
There was a problem hiding this comment.
Added, thanks!
BTW, why are enums shown as (undocumented) in the generated .md file?
|
Oh sorry, can you run |
Changeset File Check ✅
|
| // Point it to your entry point d.ts file. | ||
| "mainEntryPointFilePath": "<projectFolder>/dist/rules-unit-testing/index.d.ts" | ||
| } No newline at end of file | ||
| // Point it to your entry point d.ts file. |
There was a problem hiding this comment.
BTW, I needed to make this change otherwise the tool wouldn't run correctly. Should I leave it in the PR or remove it?
There was a problem hiding this comment.
Sorry about this again, this might be because of an updated rollup plugin dependency that was merged after you made this branch. The old plugin would write to the path you've updated it to, the new version writes to the new path - this change is causing the docgen step to fail in CI now.
Locally can you try deleting node_modules and reinstalling deps?
// in the root of the repo
rm -fr node_modules
yarn
// try docgen again
yarn docgen:all
Co-authored-by: rachelsaunders <52258509+rachelsaunders@users.noreply.github.com>
docs-devsite/vertexai.md
Outdated
| | Member | Value | Description | | ||
| | --- | --- | --- | | ||
| | AUDIO | <code>"AUDIO"</code> | Audio. | | ||
| | DOCUMENT | <code>"DOCUMENT"</code> | Document, e.g. PDF. | |
There was a problem hiding this comment.
| | DOCUMENT | <code>"DOCUMENT"</code> | Document, e.g. PDF. | | |
| | DOCUMENT | <code>"DOCUMENT"</code> | Document (for example, PDF). | |
Token measurement is broken down by modaliy, with separate counters for image, audio, etc.
Tests are in version 6.*, so this change also includes bumping update_responses.sh
Internal API proposal doc: go/firebase-vertex-token-modality-api