@ai-sdk/google-vertex 5.0.96 → 5.0.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @ai-sdk/google-vertex
2
2
 
3
+ ## 5.0.97
4
+
5
+ ### Patch Changes
6
+
7
+ - e361d39: feat(anthropic): add Claude Sonnet 5.5 support
8
+
9
+ - add the `claude-sonnet-5-5` model ID to `@ai-sdk/anthropic` and `@ai-sdk/google-vertex`, `anthropic.claude-sonnet-5-5` and `us.anthropic.claude-sonnet-5-5` to `@ai-sdk/amazon-bedrock`, and `anthropic/claude-sonnet-5.5` to `@ai-sdk/gateway`
10
+ - add the `between_tools` thinking type (`thinking: { type: 'between_tools' }`), the lowest thinking setting on `claude-sonnet-5-5`; `xhigh` and `max` effort are lowered to `high` with a warning because the API rejects them with `between_tools`
11
+ - `claude-sonnet-5-5` rejects disabled thinking: `thinking: { type: 'disabled' }` is replaced with `between_tools` thinking (with a warning), `reasoning: 'none'` maps to `between_tools` thinking, and budget-based thinking is converted to adaptive thinking
12
+ - `claude-sonnet-5-5` rejects forced tool use: `required` and named tool choices fall back to `auto`, and `structuredOutputMode: 'jsonTool'` falls back to native structured outputs, each with a warning
13
+
14
+ - Updated dependencies [e361d39]
15
+ - Updated dependencies [8373a22]
16
+ - Updated dependencies [d0290cf]
17
+ - @ai-sdk/anthropic@4.0.67
18
+ - @ai-sdk/google@4.0.84
19
+
3
20
  ## 5.0.96
4
21
 
5
22
  ### Patch Changes
package/README.md CHANGED
@@ -71,7 +71,7 @@ import { vertexAnthropic } from '@ai-sdk/google-vertex/anthropic';
71
71
  import { generateText } from 'ai';
72
72
 
73
73
  const { text } = await generateText({
74
- model: vertexAnthropic('claude-sonnet-5'),
74
+ model: vertexAnthropic('claude-sonnet-5-5'),
75
75
  prompt: 'Write a vegetarian lasagna recipe.',
76
76
  });
77
77
  ```
@@ -83,7 +83,7 @@ import { vertexAnthropic } from '@ai-sdk/google-vertex/anthropic/edge';
83
83
  import { generateText } from 'ai';
84
84
 
85
85
  const { text } = await generateText({
86
- model: vertexAnthropic('claude-sonnet-5'),
86
+ model: vertexAnthropic('claude-sonnet-5-5'),
87
87
  prompt: 'Write a vegetarian lasagna recipe.',
88
88
  });
89
89
  ```
@@ -105,7 +105,7 @@ const errorMessage = fs.readFileSync('data/error-message.txt', 'utf8');
105
105
 
106
106
  async function main() {
107
107
  const result = await generateText({
108
- model: vertexAnthropic('claude-sonnet-5', {
108
+ model: vertexAnthropic('claude-sonnet-5-5', {
109
109
  cacheControl: true,
110
110
  }),
111
111
  messages: [
@@ -203,7 +203,7 @@ const customProvider = createVertexAnthropic({
203
203
  });
204
204
 
205
205
  const { text } = await generateText({
206
- model: customProvider('claude-sonnet-5'),
206
+ model: customProvider('claude-sonnet-5-5'),
207
207
  prompt: 'Write a vegetarian lasagna recipe.',
208
208
  });
209
209
  ```
@@ -220,7 +220,7 @@ const customProvider = createVertexAnthropic({
220
220
  });
221
221
 
222
222
  const { text } = await generateText({
223
- model: customProvider('claude-sonnet-5'),
223
+ model: customProvider('claude-sonnet-5-5'),
224
224
  prompt: 'Write a vegetarian lasagna recipe.',
225
225
  });
226
226
  ```
@@ -20,7 +20,7 @@ interface GoogleCredentials {
20
20
  privateKeyId?: string;
21
21
  }
22
22
 
23
- type GoogleVertexAnthropicModelId = 'claude-sonnet-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-opus-4-8' | 'claude-opus-4-7' | 'claude-opus-4-6' | 'claude-sonnet-4-6' | 'claude-opus-4-5@20251101' | 'claude-sonnet-4-5@20250929' | 'claude-opus-4-1@20250805' | 'claude-opus-4@20250514' | 'claude-sonnet-4@20250514' | 'claude-3-7-sonnet@20250219' | 'claude-3-5-sonnet-v2@20241022' | 'claude-3-5-haiku@20241022' | 'claude-3-5-sonnet@20240620' | 'claude-3-haiku@20240307' | 'claude-3-sonnet@20240229' | 'claude-3-opus@20240229' | (string & {});
23
+ type GoogleVertexAnthropicModelId = 'claude-sonnet-5' | 'claude-sonnet-5-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-opus-4-8' | 'claude-opus-4-7' | 'claude-opus-4-6' | 'claude-sonnet-4-6' | 'claude-opus-4-5@20251101' | 'claude-sonnet-4-5@20250929' | 'claude-opus-4-1@20250805' | 'claude-opus-4@20250514' | 'claude-sonnet-4@20250514' | 'claude-3-7-sonnet@20250219' | 'claude-3-5-sonnet-v2@20241022' | 'claude-3-5-haiku@20241022' | 'claude-3-5-sonnet@20240620' | 'claude-3-haiku@20240307' | 'claude-3-sonnet@20240229' | 'claude-3-opus@20240229' | (string & {});
24
24
 
25
25
  type GoogleVertexAnthropicTools = Pick<typeof anthropicTools, 'bash_20241022' | 'bash_20250124' | 'textEditor_20241022' | 'textEditor_20250124' | 'textEditor_20250429' | 'textEditor_20250728' | 'computer_20241022' | 'webSearch_20250305' | 'toolSearchRegex_20251119' | 'toolSearchBm25_20251119'>;
26
26
  /**
@@ -10,7 +10,7 @@ import {
10
10
  } from "@ai-sdk/provider-utils";
11
11
 
12
12
  // src/version.ts
13
- var VERSION = true ? "5.0.96" : "0.0.0-test";
13
+ var VERSION = true ? "5.0.97" : "0.0.0-test";
14
14
 
15
15
  // src/edge/google-vertex-auth-edge.ts
16
16
  var loadCredentials = async () => {
@@ -3,7 +3,7 @@ import { ProviderV4, LanguageModelV4 } from '@ai-sdk/provider';
3
3
  import { Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
4
4
  import { anthropicTools } from '@ai-sdk/anthropic/internal';
5
5
 
6
- type GoogleVertexAnthropicModelId = 'claude-sonnet-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-opus-4-8' | 'claude-opus-4-7' | 'claude-opus-4-6' | 'claude-sonnet-4-6' | 'claude-opus-4-5@20251101' | 'claude-sonnet-4-5@20250929' | 'claude-opus-4-1@20250805' | 'claude-opus-4@20250514' | 'claude-sonnet-4@20250514' | 'claude-3-7-sonnet@20250219' | 'claude-3-5-sonnet-v2@20241022' | 'claude-3-5-haiku@20241022' | 'claude-3-5-sonnet@20240620' | 'claude-3-haiku@20240307' | 'claude-3-sonnet@20240229' | 'claude-3-opus@20240229' | (string & {});
6
+ type GoogleVertexAnthropicModelId = 'claude-sonnet-5' | 'claude-sonnet-5-5' | 'claude-fable-5' | 'claude-fable-5-1' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-opus-4-8' | 'claude-opus-4-7' | 'claude-opus-4-6' | 'claude-sonnet-4-6' | 'claude-opus-4-5@20251101' | 'claude-sonnet-4-5@20250929' | 'claude-opus-4-1@20250805' | 'claude-opus-4@20250514' | 'claude-sonnet-4@20250514' | 'claude-3-7-sonnet@20250219' | 'claude-3-5-sonnet-v2@20241022' | 'claude-3-5-haiku@20241022' | 'claude-3-5-sonnet@20240620' | 'claude-3-haiku@20240307' | 'claude-3-sonnet@20240229' | 'claude-3-opus@20240229' | (string & {});
7
7
 
8
8
  type GoogleVertexAnthropicTools = Pick<typeof anthropicTools, 'bash_20241022' | 'bash_20250124' | 'textEditor_20241022' | 'textEditor_20250124' | 'textEditor_20250429' | 'textEditor_20250728' | 'computer_20241022' | 'webSearch_20250305' | 'toolSearchRegex_20251119' | 'toolSearchBm25_20251119'>;
9
9
  /**
@@ -18,7 +18,7 @@ import {
18
18
  } from "@ai-sdk/provider-utils";
19
19
 
20
20
  // src/version.ts
21
- var VERSION = true ? "5.0.96" : "0.0.0-test";
21
+ var VERSION = true ? "5.0.97" : "0.0.0-test";
22
22
 
23
23
  // src/google-vertex-embedding-model.ts
24
24
  import {
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  } from "@ai-sdk/provider-utils";
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "5.0.96" : "0.0.0-test";
35
+ var VERSION = true ? "5.0.97" : "0.0.0-test";
36
36
 
37
37
  // src/google-vertex-embedding-model.ts
38
38
  import {
@@ -10,7 +10,7 @@ import {
10
10
  } from "@ai-sdk/provider-utils";
11
11
 
12
12
  // src/version.ts
13
- var VERSION = true ? "5.0.96" : "0.0.0-test";
13
+ var VERSION = true ? "5.0.97" : "0.0.0-test";
14
14
 
15
15
  // src/edge/google-vertex-auth-edge.ts
16
16
  var loadCredentials = async () => {
@@ -10,7 +10,7 @@ import {
10
10
  } from "@ai-sdk/provider-utils";
11
11
 
12
12
  // src/version.ts
13
- var VERSION = true ? "5.0.96" : "0.0.0-test";
13
+ var VERSION = true ? "5.0.97" : "0.0.0-test";
14
14
 
15
15
  // src/edge/google-vertex-auth-edge.ts
16
16
  var loadCredentials = async () => {
@@ -1549,11 +1549,11 @@ You can use the following optional settings to customize the provider instance:
1549
1549
  ### Language Models
1550
1550
 
1551
1551
  You can create models that call the [Anthropic Messages API](https://docs.anthropic.com/claude/reference/messages_post) using the provider instance.
1552
- The first argument is the model id, e.g. `claude-sonnet-5`.
1552
+ The first argument is the model id, e.g. `claude-sonnet-5-5`.
1553
1553
  Some models have multi-modal capabilities.
1554
1554
 
1555
1555
  ```ts
1556
- const model = vertexAnthropic('claude-sonnet-5');
1556
+ const model = vertexAnthropic('claude-sonnet-5-5');
1557
1557
  ```
1558
1558
 
1559
1559
  You can use Anthropic language models to generate text with the `generateText` function:
@@ -1563,7 +1563,7 @@ import { vertexAnthropic } from '@ai-sdk/google-vertex/anthropic';
1563
1563
  import { generateText } from 'ai';
1564
1564
 
1565
1565
  const { text } = await generateText({
1566
- model: vertexAnthropic('claude-sonnet-5'),
1566
+ model: vertexAnthropic('claude-sonnet-5-5'),
1567
1567
  prompt: 'Write a vegetarian lasagna recipe for 4 people.',
1568
1568
  });
1569
1569
  ```
@@ -1648,7 +1648,7 @@ import { generateText } from 'ai';
1648
1648
  const errorMessage = '... long error message ...';
1649
1649
 
1650
1650
  const result = await generateText({
1651
- model: vertexAnthropic('claude-sonnet-5'),
1651
+ model: vertexAnthropic('claude-sonnet-5-5'),
1652
1652
  messages: [
1653
1653
  {
1654
1654
  role: 'user',
@@ -1682,7 +1682,7 @@ You can also use cache control on system messages by providing multiple system m
1682
1682
 
1683
1683
  ```ts highlight="3,7-9"
1684
1684
  const result = await generateText({
1685
- model: vertexAnthropic('claude-sonnet-5'),
1685
+ model: vertexAnthropic('claude-sonnet-5-5'),
1686
1686
  messages: [
1687
1687
  {
1688
1688
  role: 'system',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google-vertex",
3
- "version": "5.0.96",
3
+ "version": "5.0.97",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -71,8 +71,8 @@
71
71
  }
72
72
  },
73
73
  "dependencies": {
74
- "@ai-sdk/anthropic": "4.0.66",
75
- "@ai-sdk/google": "4.0.83",
74
+ "@ai-sdk/anthropic": "4.0.67",
75
+ "@ai-sdk/google": "4.0.84",
76
76
  "@ai-sdk/openai-compatible": "3.0.58",
77
77
  "@ai-sdk/provider": "4.0.19",
78
78
  "@ai-sdk/provider-utils": "5.0.50",
@@ -1,6 +1,7 @@
1
1
  // https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/claude
2
2
  export type GoogleVertexAnthropicModelId =
3
3
  | 'claude-sonnet-5'
4
+ | 'claude-sonnet-5-5'
4
5
  | 'claude-fable-5'
5
6
  | 'claude-fable-5-1'
6
7
  | 'claude-opus-5'