Skip to content

Commit 7534eb2

Browse files
authored
chore(js/plugins/google-genai): Deprecate gemini-3-pro-preview (firebase#4859)
1 parent 5efbd39 commit 7534eb2

File tree

6 files changed

+9
-67
lines changed

6 files changed

+9
-67
lines changed

js/plugins/google-genai/src/googleai/gemini.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ const KNOWN_GEMINI_MODELS = {
441441
),
442442
'gemini-3.1-pro-preview': commonRef('gemini-3.1-pro-preview'),
443443
'gemini-3-flash-preview': commonRef('gemini-3-flash-preview'),
444-
'gemini-3-pro-preview': commonRef('gemini-3-pro-preview'),
445444
'gemini-2.5-pro': commonRef('gemini-2.5-pro'),
446445
'gemini-2.5-flash': commonRef('gemini-2.5-flash'),
447446
'gemini-2.5-flash-lite': commonRef('gemini-2.5-flash-lite'),

js/plugins/google-genai/src/vertexai/gemini.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ const GENERIC_IMAGE_MODEL = commonRef(
424424
export const KNOWN_GEMINI_MODELS = {
425425
'gemini-3.1-pro-preview': commonRef('gemini-3.1-pro-preview'),
426426
'gemini-3-flash-preview': commonRef('gemini-3-flash-preview'),
427-
'gemini-3-pro-preview': commonRef('gemini-3-pro-preview'),
428427
'gemini-2.5-flash-lite': commonRef('gemini-2.5-flash-lite'),
429428
'gemini-2.5-pro': commonRef('gemini-2.5-pro'),
430429
'gemini-2.5-flash': commonRef('gemini-2.5-flash'),

js/plugins/google-genai/tests/googleai/gemini_test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,10 @@ describe('Google AI Gemini', () => {
429429
});
430430

431431
it('passes thinkingLevel to the API', async () => {
432-
const model = defineModel('gemini-3-pro-preview', defaultPluginOptions);
432+
const model = defineModel(
433+
'gemini-3.1-pro-preview',
434+
defaultPluginOptions
435+
);
433436
mockFetchResponse(defaultApiResponse);
434437
const request: GenerateRequest<typeof GeminiConfigSchema> = {
435438
...minimalRequest,

js/plugins/google-genai/tests/vertexai/gemini_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ describe('Vertex AI Gemini', () => {
366366
},
367367
},
368368
};
369-
const model = defineModel('gemini-3-pro-preview', clientOptions);
369+
const model = defineModel('gemini-3.1-pro-preview', clientOptions);
370370
await model.run(request);
371371

372372
const apiRequest: GenerateContentRequest = JSON.parse(

js/testapps/basic-gemini/src/index-vertexai.ts

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,6 @@ ai.defineFlow('basic-hi', async () => {
3737
return text;
3838
});
3939

40-
// Gemini 3.0 thinkingLevel config
41-
ai.defineFlow(
42-
{
43-
name: 'thinking-level-pro',
44-
inputSchema: z.enum(['LOW', 'HIGH']),
45-
outputSchema: z.any(),
46-
},
47-
async (level) => {
48-
const { text } = await ai.generate({
49-
model: vertexAI.model('gemini-3-pro-preview'),
50-
prompt: [
51-
'Alice, Bob, and Carol each live in a different house on the ',
52-
'same street: red, green, and blue. The person who lives in the red house ',
53-
'owns a cat. Bob does not live in the green house. Carol owns a dog. The ',
54-
'green house is to the left of the red house. Alice does not own a cat. ',
55-
'The person in the blue house owns a fish. ',
56-
'Who lives in each house, and what pet do they own? Provide your ',
57-
'step-by-step reasoning.',
58-
].join(''),
59-
config: {
60-
location: 'global',
61-
thinkingConfig: {
62-
thinkingLevel: level,
63-
},
64-
},
65-
});
66-
return text;
67-
}
68-
);
69-
7040
// Gemini 3.1 thinkingLevel config
7141
ai.defineFlow(
7242
{
@@ -340,7 +310,7 @@ ai.defineFlow(
340310
},
341311
async (location, { sendChunk }) => {
342312
const { response, stream } = ai.generateStream({
343-
model: vertexAI.model('gemini-3-pro-preview'),
313+
model: vertexAI.model('gemini-3.1-pro-preview'),
344314
config: {
345315
temperature: 1,
346316
functionCallingConfig: {
@@ -442,7 +412,7 @@ ai.defineFlow('reasoning', async (_, { sendChunk }) => {
442412
ai.defineFlow('gemini-media-resolution', async (_) => {
443413
const plant = fs.readFileSync('palm_tree.png', { encoding: 'base64' });
444414
const { text } = await ai.generate({
445-
model: vertexAI.model('gemini-3-pro-preview'),
415+
model: vertexAI.model('gemini-3.1-pro-preview'),
446416
prompt: [
447417
{ text: 'What is in this picture?' },
448418
{

js/testapps/basic-gemini/src/index.ts

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -80,35 +80,6 @@ ai.defineFlow('basic-hi-with-fallback', async () => {
8080
return text;
8181
});
8282

83-
// Gemini 3.0 thinkingLevel config. Pro can have Low or High
84-
ai.defineFlow(
85-
{
86-
name: 'thinking-level-pro',
87-
inputSchema: z.enum(['LOW', 'HIGH']),
88-
},
89-
async (level) => {
90-
const { text } = await ai.generate({
91-
model: googleAI.model('gemini-3-pro-preview'),
92-
prompt: [
93-
'Alice, Bob, and Carol each live in a different house on the ',
94-
'same street: red, green, and blue. The person who lives in the red house ',
95-
'owns a cat. Bob does not live in the green house. Carol owns a dog. The ',
96-
'green house is to the left of the red house. Alice does not own a cat. ',
97-
'The person in the blue house owns a fish. ',
98-
'Who lives in each house, and what pet do they own? Provide your ',
99-
'step-by-step reasoning.',
100-
].join(''),
101-
config: {
102-
thinkingConfig: {
103-
thinkingLevel: level,
104-
includeThoughts: true,
105-
},
106-
},
107-
});
108-
return text;
109-
}
110-
);
111-
11283
// Gemini 3 Flash can have minimal and medium thinking levels too.
11384
ai.defineFlow(
11485
{
@@ -343,7 +314,7 @@ ai.defineFlow(
343314
},
344315
async (_, { sendChunk }) => {
345316
const { response, stream } = ai.generateStream({
346-
model: googleAI.model('gemini-3-pro-preview'),
317+
model: googleAI.model('gemini-3.1-pro-preview'),
347318
config: {
348319
temperature: 1,
349320
},
@@ -442,7 +413,7 @@ ai.defineFlow('reasoning', async (_, { sendChunk }) => {
442413
ai.defineFlow('gemini-media-resolution', async (_) => {
443414
const plant = fs.readFileSync('palm_tree.png', { encoding: 'base64' });
444415
const { text } = await ai.generate({
445-
model: googleAI.model('gemini-3-pro-preview'),
416+
model: googleAI.model('gemini-3.1-pro-preview'),
446417
prompt: [
447418
{ text: 'What is in this picture?' },
448419
{

0 commit comments

Comments
 (0)