@ai-sdk/google-vertex 4.0.60 → 4.0.61

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,12 @@
1
1
  # @ai-sdk/google-vertex
2
2
 
3
+ ## 4.0.61
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [b094c07]
8
+ - @ai-sdk/anthropic@3.0.46
9
+
3
10
  ## 4.0.60
4
11
 
5
12
  ### Patch Changes
@@ -32,7 +32,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
32
32
  var import_provider_utils = require("@ai-sdk/provider-utils");
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "4.0.60" : "0.0.0-test";
35
+ var VERSION = true ? "4.0.61" : "0.0.0-test";
36
36
 
37
37
  // src/edge/google-vertex-auth-edge.ts
38
38
  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 ? "4.0.60" : "0.0.0-test";
13
+ var VERSION = true ? "4.0.61" : "0.0.0-test";
14
14
 
15
15
  // src/edge/google-vertex-auth-edge.ts
16
16
  var loadCredentials = async () => {
@@ -33,7 +33,7 @@ var import_internal3 = require("@ai-sdk/google/internal");
33
33
  var import_provider_utils5 = require("@ai-sdk/provider-utils");
34
34
 
35
35
  // src/version.ts
36
- var VERSION = true ? "4.0.60" : "0.0.0-test";
36
+ var VERSION = true ? "4.0.61" : "0.0.0-test";
37
37
 
38
38
  // src/google-vertex-embedding-model.ts
39
39
  var import_provider = require("@ai-sdk/provider");
@@ -14,7 +14,7 @@ import {
14
14
  } from "@ai-sdk/provider-utils";
15
15
 
16
16
  // src/version.ts
17
- var VERSION = true ? "4.0.60" : "0.0.0-test";
17
+ var VERSION = true ? "4.0.61" : "0.0.0-test";
18
18
 
19
19
  // src/google-vertex-embedding-model.ts
20
20
  import {
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ var import_internal3 = require("@ai-sdk/google/internal");
55
55
  var import_provider_utils5 = require("@ai-sdk/provider-utils");
56
56
 
57
57
  // src/version.ts
58
- var VERSION = true ? "4.0.60" : "0.0.0-test";
58
+ var VERSION = true ? "4.0.61" : "0.0.0-test";
59
59
 
60
60
  // src/google-vertex-embedding-model.ts
61
61
  var import_provider = require("@ai-sdk/provider");
package/dist/index.mjs CHANGED
@@ -35,7 +35,7 @@ import {
35
35
  } from "@ai-sdk/provider-utils";
36
36
 
37
37
  // src/version.ts
38
- var VERSION = true ? "4.0.60" : "0.0.0-test";
38
+ var VERSION = true ? "4.0.61" : "0.0.0-test";
39
39
 
40
40
  // src/google-vertex-embedding-model.ts
41
41
  import {
@@ -715,30 +715,33 @@ The errors that you get in this case look like this:
715
715
  By default, structured outputs are enabled (and for tool calling they are required).
716
716
  You can disable structured outputs for object generation as a workaround:
717
717
 
718
- ```ts highlight="6,11"
718
+ ```ts highlight="7,12"
719
719
  import { vertex } from '@ai-sdk/google-vertex';
720
720
  import { type GoogleLanguageModelOptions } from '@ai-sdk/google';
721
+ import { generateText, Output } from 'ai';
721
722
 
722
- const result = await generateObject({
723
+ const result = await generateText({
723
724
  model: vertex('gemini-1.5-pro'),
724
725
  providerOptions: {
725
726
  vertex: {
726
727
  structuredOutputs: false,
727
728
  } satisfies GoogleLanguageModelOptions,
728
729
  },
729
- schema: z.object({
730
- name: z.string(),
731
- age: z.number(),
732
- contact: z.union([
733
- z.object({
734
- type: z.literal('email'),
735
- value: z.string(),
736
- }),
737
- z.object({
738
- type: z.literal('phone'),
739
- value: z.string(),
740
- }),
741
- ]),
730
+ output: Output.object({
731
+ schema: z.object({
732
+ name: z.string(),
733
+ age: z.number(),
734
+ contact: z.union([
735
+ z.object({
736
+ type: z.literal('email'),
737
+ value: z.string(),
738
+ }),
739
+ z.object({
740
+ type: z.literal('phone'),
741
+ value: z.string(),
742
+ }),
743
+ ]),
744
+ }),
742
745
  }),
743
746
  prompt: 'Generate an example person for testing.',
744
747
  });
@@ -1403,13 +1406,14 @@ const { text } = await generateText({
1403
1406
  });
1404
1407
  ```
1405
1408
 
1406
- Anthropic language models can also be used in the `streamText`, `generateObject`, and `streamObject` functions
1409
+ Anthropic language models can also be used in the `streamText` function
1410
+ and support structured data generation with [`Output`](/docs/reference/ai-sdk-core/output)
1407
1411
  (see [AI SDK Core](/docs/ai-sdk-core)).
1408
1412
 
1409
1413
  <Note>
1410
1414
  The Anthropic API returns streaming tool calls all at once after a delay. This
1411
- causes the `streamObject` function to generate the object fully after a delay
1412
- instead of streaming it incrementally.
1415
+ causes structured output generation to complete fully after a delay instead of
1416
+ streaming incrementally.
1413
1417
  </Note>
1414
1418
 
1415
1419
  The following optional provider options are available for Anthropic models:
@@ -1466,8 +1470,8 @@ In the messages and message parts, you can use the `providerOptions` property to
1466
1470
  You need to set the `anthropic` property in the `providerOptions` object to `{ cacheControl: { type: 'ephemeral' } }` to set a cache control breakpoint.
1467
1471
 
1468
1472
  The cache creation input tokens are then returned in the `providerMetadata` object
1469
- for `generateText` and `generateObject`, again under the `anthropic` property.
1470
- When you use `streamText` or `streamObject`, the response contains a promise
1473
+ for `generateText`, again under the `anthropic` property.
1474
+ When you use `streamText`, the response contains a promise
1471
1475
  that resolves to the metadata. Alternatively you can receive it in the
1472
1476
  `onFinish` callback.
1473
1477
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google-vertex",
3
- "version": "4.0.60",
3
+ "version": "4.0.61",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -48,10 +48,10 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "google-auth-library": "^10.5.0",
51
- "@ai-sdk/anthropic": "3.0.45",
52
- "@ai-sdk/google": "3.0.30",
51
+ "@ai-sdk/anthropic": "3.0.46",
53
52
  "@ai-sdk/provider": "3.0.8",
54
- "@ai-sdk/provider-utils": "4.0.15"
53
+ "@ai-sdk/provider-utils": "4.0.15",
54
+ "@ai-sdk/google": "3.0.30"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/node": "20.17.24",