Skip to content

Commit 00a1e93

Browse files
github-actions[bot]felixarntzclaude
authored
Backport: Backport: feat(provider/google): add gemini-3.5-flash (#15439)
This is an automated backport of #15436 to the release-v5.0 branch. FYI @felixarntz ~~This backport has conflicts that need to be resolved manually.~~ Conflicts resolved. ### `git cherry-pick` output ``` Auto-merging content/providers/01-ai-sdk-providers/15-google-generative-ai.mdx Auto-merging content/providers/01-ai-sdk-providers/16-google-vertex.mdx CONFLICT (content): Merge conflict in content/providers/01-ai-sdk-providers/16-google-vertex.mdx CONFLICT (file location): examples/ai-functions/src/generate-text/google/gemini-3-5-flash.ts added in 756fec1 (Backport: feat(provider/google): add `gemini-3.5-flash` (#15436)) inside a directory that was renamed in HEAD, suggesting it should perhaps be moved to examples/ai-core/src/generate-text/gemini-3-5-flash.ts. Auto-merging examples/ai-core/src/generate-text/google-function-call-id.ts CONFLICT (file location): examples/ai-functions/src/generate-text/google/interactions-gemini-3-5-flash.ts added in 756fec1 (Backport: feat(provider/google): add `gemini-3.5-flash` (#15436)) inside a directory that was renamed in HEAD, suggesting it should perhaps be moved to examples/ai-core/src/generate-text/interactions-gemini-3-5-flash.ts. CONFLICT (file location): examples/ai-functions/src/stream-text/google/gemini-3-5-flash.ts added in 756fec1 (Backport: feat(provider/google): add `gemini-3.5-flash` (#15436)) inside a directory that was renamed in HEAD, suggesting it should perhaps be moved to examples/ai-core/src/stream-text/gemini-3-5-flash.ts. Auto-merging examples/ai-core/src/stream-text/google-function-call-id.ts CONFLICT (file location): examples/ai-functions/src/stream-text/google/interactions-gemini-3-5-flash.ts added in 756fec1 (Backport: feat(provider/google): add `gemini-3.5-flash` (#15436)) inside a directory that was renamed in HEAD, suggesting it should perhaps be moved to examples/ai-core/src/stream-text/interactions-gemini-3-5-flash.ts. Auto-merging packages/google-vertex/src/google-vertex-options.ts Auto-merging packages/google/src/google-generative-ai-options.ts CONFLICT (modify/delete): packages/google/src/interactions/google-interactions-language-model-options.ts deleted in HEAD and modified in 756fec1 (Backport: feat(provider/google): add `gemini-3.5-flash` (#15436)). Version 756fec1 (Backport: feat(provider/google): add `gemini-3.5-flash` (#15436)) of packages/google/src/interactions/google-interactions-language-model-options.ts left in tree. error: could not apply 756fec1... Backport: feat(provider/google): add `gemini-3.5-flash` (#15436) hint: After resolving the conflicts, mark them with hint: "git add/rm <pathspec>", then run hint: "git cherry-pick --continue". hint: You can instead skip this commit with "git cherry-pick --skip". hint: To abort and get back to the state before "git cherry-pick", hint: run "git cherry-pick --abort". hint: Disable this message with "git config set advice.mergeConflict false" ``` --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Felix Arntz <felix.arntz@vercel.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 253b1f6 commit 00a1e93

10 files changed

Lines changed: 47 additions & 2 deletions

File tree

.changeset/soft-pillows-shop.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@ai-sdk/google-vertex": patch
3+
"@ai-sdk/gateway": patch
4+
"@ai-sdk/google": patch
5+
---
6+
7+
feat(provider/google): add `gemini-3.5-flash`

content/providers/01-ai-sdk-providers/15-google-generative-ai.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,7 @@ The following Zod features are known to not work with Google Generative AI:
10031003

10041004
| Model | Image Input | Object Generation | Tool Usage | Tool Streaming | Google Search | URL Context |
10051005
| ------------------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- |
1006+
| `gemini-3.5-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
10061007
| `gemini-3.1-pro-preview` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
10071008
| `gemini-3.1-flash-image-preview` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
10081009
| `gemini-3-pro-preview` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |

content/providers/01-ai-sdk-providers/16-google-vertex.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ The following Zod features are known to not work with Google Vertex:
621621

622622
| Model | Image Input | Object Generation | Tool Usage | Tool Streaming |
623623
| ---------------------- | ------------------- | ------------------- | ------------------- | ------------------- |
624+
| `gemini-3.5-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
624625
| `gemini-2.0-flash-001` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
625626
| `gemini-2.0-flash-exp` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
626627
| `gemini-1.5-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |

examples/ai-core/src/generate-text/google-function-call-id.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ run(async () => {
2222

2323
// Turn 1: model emits parallel tool calls; tools execute automatically.
2424
const turn1 = await generateText({
25-
model: google('gemini-3-flash-preview'),
25+
model: google('gemini-3.5-flash'),
2626
tools: { weather: weatherTool },
2727
messages,
2828
stopWhen: stepCountIs(1),
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { google } from '@ai-sdk/google';
2+
import { generateText } from 'ai';
3+
import { run } from '../lib/run';
4+
5+
run(async () => {
6+
const result = await generateText({
7+
model: google('gemini-3.5-flash'),
8+
prompt: 'Invent a new holiday and describe its traditions.',
9+
});
10+
11+
console.log(result.text);
12+
console.log();
13+
console.log('Token usage:', result.usage);
14+
console.log('Finish reason:', result.finishReason);
15+
});

examples/ai-core/src/stream-text/google-function-call-id.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ run(async () => {
2323

2424
// Turn 1: model emits parallel tool calls; tools execute automatically.
2525
const turn1 = streamText({
26-
model: google('gemini-3-flash-preview'),
26+
model: google('gemini-3.5-flash'),
2727
tools: { weather: weatherTool },
2828
messages,
2929
stopWhen: stepCountIs(1),
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { google } from '@ai-sdk/google';
2+
import { streamText } from 'ai';
3+
import { run } from '../lib/run';
4+
5+
run(async () => {
6+
const result = streamText({
7+
model: google('gemini-3.5-flash'),
8+
prompt: 'Invent a new holiday and describe its traditions.',
9+
});
10+
11+
for await (const textPart of result.textStream) {
12+
process.stdout.write(textPart);
13+
}
14+
15+
console.log();
16+
console.log('Token usage:', await result.usage);
17+
console.log('Finish reason:', await result.finishReason);
18+
});

packages/gateway/src/gateway-language-model-settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export type GatewayModelId =
6363
| 'google/gemini-3.1-flash-lite'
6464
| 'google/gemini-3.1-flash-lite-preview'
6565
| 'google/gemini-3.1-pro-preview'
66+
| 'google/gemini-3.5-flash'
6667
| 'google/gemma-4-26b-a4b-it'
6768
| 'google/gemma-4-31b-it'
6869
| 'inception/mercury-2'

packages/google-vertex/src/google-vertex-options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// https://console.cloud.google.com/vertex-ai/studio/
44
export type GoogleVertexModelId =
55
// Stable models
6+
| 'gemini-3.5-flash'
67
| 'gemini-2.5-pro'
78
| 'gemini-2.5-flash'
89
| 'gemini-2.5-flash-lite'

packages/google/src/google-generative-ai-options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export type GoogleGenerativeAIModelId =
4444
| 'gemini-3.1-flash-image-preview'
4545
| 'gemini-3.1-flash-lite-preview'
4646
| 'gemini-3.1-flash-tts-preview'
47+
| 'gemini-3.5-flash'
4748
// latest version
4849
// https://ai.google.dev/gemini-api/docs/models#latest
4950
| 'gemini-pro-latest'

0 commit comments

Comments
 (0)