-
Notifications
You must be signed in to change notification settings - Fork 989
test(ai): Add all general use models to integration tests #9413
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ import { | |
| import { testConfigs } from './constants'; | ||
|
|
||
| describe('Generate Content', function () { | ||
| this.timeout(20_000); | ||
| this.timeout(90_000); // gemini 3 requests take a long time, especially when using google search and url context. | ||
| testConfigs.forEach(testConfig => { | ||
| describe(`${testConfig.toString()}`, () => { | ||
| const commonGenerationConfig: GenerationConfig = { | ||
|
|
@@ -175,8 +175,9 @@ describe('Generate Content', function () { | |
| describe('URL Context', async () => { | ||
| // URL Context is not supported in Google AI for gemini-2.0-flash | ||
| if ( | ||
| testConfig.ai.backend.backendType === BackendType.GOOGLE_AI && | ||
| testConfig.model === 'gemini-2.0-flash' | ||
| ['gemini-2.0-flash-001', 'gemini-2.0-flash-lite-001'].includes( | ||
| testConfig.model | ||
| ) // Models that don't support URL Context | ||
| ) { | ||
|
Comment on lines
177
to
181
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logic in this |
||
| return; | ||
| } | ||
|
|
@@ -232,9 +233,7 @@ describe('Generate Content', function () { | |
| const urlContextMetadata = | ||
| response.candidates?.[0].urlContextMetadata; | ||
| const groundingMetadata = response.candidates?.[0].groundingMetadata; | ||
| expect(trimmedText).to.contain( | ||
| 'hypermedia information retrieval initiative' | ||
| ); | ||
| expect(trimmedText.length).to.be.greaterThan(0); | ||
| expect(urlContextMetadata?.urlMetadata).to.exist; | ||
| expect( | ||
| urlContextMetadata?.urlMetadata.length | ||
|
|
@@ -302,6 +301,10 @@ describe('Generate Content', function () { | |
| }); | ||
|
|
||
| it('generateContent: code execution', async () => { | ||
| if (testConfig.model === 'gemini-2.0-flash-lite-001') { | ||
| // This model does not support code execution | ||
| return; | ||
| } | ||
| const model = getGenerativeModel(testConfig.ai, { | ||
| model: testConfig.model, | ||
| generationConfig: commonGenerationConfig, | ||
|
|
||
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 logic for determining
expectedImageTokensis duplicated in a few places in this file (e.g., in the 'text, image, and audio input' test). To improve maintainability, consider extracting it into a shared helper function. This would centralize the logic and make future updates easier.