-
Notifications
You must be signed in to change notification settings - Fork 166
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
Fix count tokens to include model params #209
Conversation
// cachedContent: modelParams?.cachedContent?.name, | ||
// contents: [], | ||
// }, | ||
// }; |
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.
Should this be removed?
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.
Yep, thanks!
model: "gemini-1.5-flash", | ||
}); | ||
// expect(result.generateContentRequest.model).to.equal("gemini-1.5-flash"); | ||
// expect(result.generateContentRequest.contents).to.equal("gemini-1.5-flash"); |
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.
Remove these?
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.
Done.
Count tokens request should include any params set on the model parent class, including systemInstruction, tools, cachedContent.
Updated samples to use this.
generationConfig, toolConfig, and safetySettings don't seem like they would affect tokenCount but might as well pass them through, as they are part of a complete GenerateContentRequest and may affect tokenCount in the future.