@ai-sdk/google-vertex 4.0.60 → 4.0.62
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 +14 -0
- package/dist/anthropic/edge/index.js +1 -1
- package/dist/anthropic/edge/index.mjs +1 -1
- package/dist/edge/index.js +1 -1
- package/dist/edge/index.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/16-google-vertex.mdx +24 -20
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @ai-sdk/google-vertex
|
|
2
2
|
|
|
3
|
+
## 4.0.62
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [2fa3ca8]
|
|
8
|
+
- @ai-sdk/google@3.0.31
|
|
9
|
+
|
|
10
|
+
## 4.0.61
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [b094c07]
|
|
15
|
+
- @ai-sdk/anthropic@3.0.46
|
|
16
|
+
|
|
3
17
|
## 4.0.60
|
|
4
18
|
|
|
5
19
|
### 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.
|
|
35
|
+
var VERSION = true ? "4.0.62" : "0.0.0-test";
|
|
36
36
|
|
|
37
37
|
// src/edge/google-vertex-auth-edge.ts
|
|
38
38
|
var loadCredentials = async () => {
|
package/dist/edge/index.js
CHANGED
|
@@ -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.
|
|
36
|
+
var VERSION = true ? "4.0.62" : "0.0.0-test";
|
|
37
37
|
|
|
38
38
|
// src/google-vertex-embedding-model.ts
|
|
39
39
|
var import_provider = require("@ai-sdk/provider");
|
package/dist/edge/index.mjs
CHANGED
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.
|
|
58
|
+
var VERSION = true ? "4.0.62" : "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
|
@@ -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="
|
|
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
|
|
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
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
z.
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
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
|
|
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
|
|
1412
|
-
|
|
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
|
|
1470
|
-
When you use `streamText
|
|
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.
|
|
3
|
+
"version": "4.0.62",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"google-auth-library": "^10.5.0",
|
|
51
|
-
"@ai-sdk/anthropic": "3.0.
|
|
52
|
-
"@ai-sdk/google": "3.0.
|
|
51
|
+
"@ai-sdk/anthropic": "3.0.46",
|
|
52
|
+
"@ai-sdk/google": "3.0.31",
|
|
53
53
|
"@ai-sdk/provider": "3.0.8",
|
|
54
54
|
"@ai-sdk/provider-utils": "4.0.15"
|
|
55
55
|
},
|