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

Add systemInstruction, tools, and generationConfig to CountTokensRequest #8827

Merged
merged 3 commits into from
Mar 6, 2025

Conversation

dlarocque
Copy link
Contributor

Fixes b/397973753 (internal)

Add systemInstruction, tools, and generationConfig to CountTokensRequest.
This allows users to count totalBillableChracters for requests that include anything beyond the content.

@dlarocque dlarocque requested review from a team as code owners March 4, 2025 16:17
Copy link

changeset-bot bot commented Mar 4, 2025

🦋 Changeset detected

Latest commit: 3ce689f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@firebase/vertexai Minor
firebase Patch

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

*/
tools?: Tool[];
/**
* Configuration options used for content-related requests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm... this description doesn't seem quite right. Let's riff on something like this?

Configuration with parameter values that control how the model generates a response.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm... this description doesn't seem quite right.

This comment was copied from the current devsite docs for GenerationConfig. Do you think this should also be updated in the GenerationConfig interface?

Configuration with parameter values that control how the model generates a response.

In a JS context, parameters specifically refer to function inputs, while generationConfig is an object with properties. I would suggest "Object containing properties that control how the model generates a response", but that seems a bit verbose to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Configuration options that control how the model generates a response." ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Configuration options that control how the model generates a response." ?

+1

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 4, 2025

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 4, 2025

Copy link
Contributor

@hsubox76 hsubox76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget the changeset (minor)

*/
tools?: Tool[];
/**
* Configuration options used for content-related requests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Configuration options that control how the model generates a response." ?

@dlarocque dlarocque requested review from a team as code owners March 4, 2025 18:47
@dlarocque dlarocque merged commit 25985ac into main Mar 6, 2025
36 of 37 checks passed
@dlarocque dlarocque deleted the dl/count-tokens branch March 6, 2025 15:06
@google-oss-bot google-oss-bot mentioned this pull request Mar 18, 2025
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.

None yet

4 participants