@ai-sdk/google-vertex 5.0.0-beta.52 → 5.0.0-beta.54
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 +18 -0
- package/README.md +0 -1
- package/dist/anthropic/edge/index.js +1 -1
- package/dist/edge/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/maas/edge/index.js +1 -1
- package/docs/16-google-vertex.mdx +10 -8
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @ai-sdk/google-vertex
|
|
2
2
|
|
|
3
|
+
## 5.0.0-beta.54
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 832f86f: fix(anthropic): remove cacheCreationInputTokens from providerMetadata
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [832f86f]
|
|
12
|
+
- @ai-sdk/anthropic@4.0.0-beta.33
|
|
13
|
+
|
|
14
|
+
## 5.0.0-beta.53
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [ad0b376]
|
|
19
|
+
- @ai-sdk/anthropic@4.0.0-beta.32
|
|
20
|
+
|
|
3
21
|
## 5.0.0-beta.52
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -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.0-beta.
|
|
13
|
+
var VERSION = true ? "5.0.0-beta.54" : "0.0.0-test";
|
|
14
14
|
|
|
15
15
|
// src/edge/google-vertex-auth-edge.ts
|
|
16
16
|
var loadCredentials = async () => {
|
package/dist/edge/index.js
CHANGED
package/dist/index.js
CHANGED
package/dist/maas/edge/index.js
CHANGED
|
@@ -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.0-beta.
|
|
13
|
+
var VERSION = true ? "5.0.0-beta.54" : "0.0.0-test";
|
|
14
14
|
|
|
15
15
|
// src/edge/google-vertex-auth-edge.ts
|
|
16
16
|
var loadCredentials = async () => {
|
|
@@ -1538,13 +1538,12 @@ on how to integrate reasoning into your chatbot.
|
|
|
1538
1538
|
In the messages and message parts, you can use the `providerOptions` property to set cache control breakpoints.
|
|
1539
1539
|
You need to set the `anthropic` property in the `providerOptions` object to `{ cacheControl: { type: 'ephemeral' } }` to set a cache control breakpoint.
|
|
1540
1540
|
|
|
1541
|
-
|
|
1542
|
-
for `generateText
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
`onFinish` callback.
|
|
1541
|
+
Cache read and cache write (creation) token counts are returned on the standard
|
|
1542
|
+
`usage` object for both `generateText` and `streamText`. You can access them at
|
|
1543
|
+
`result.usage.inputTokenDetails.cacheReadTokens` and
|
|
1544
|
+
`result.usage.inputTokenDetails.cacheWriteTokens`.
|
|
1546
1545
|
|
|
1547
|
-
```ts highlight="8,18-20,29-
|
|
1546
|
+
```ts highlight="8,18-20,29-32"
|
|
1548
1547
|
import { vertexAnthropic } from '@ai-sdk/google-vertex/anthropic';
|
|
1549
1548
|
import { generateText } from 'ai';
|
|
1550
1549
|
|
|
@@ -1571,8 +1570,11 @@ const result = await generateText({
|
|
|
1571
1570
|
});
|
|
1572
1571
|
|
|
1573
1572
|
console.log(result.text);
|
|
1574
|
-
console.log(result.
|
|
1575
|
-
|
|
1573
|
+
console.log('Cache read tokens:', result.usage.inputTokenDetails.cacheReadTokens);
|
|
1574
|
+
console.log(
|
|
1575
|
+
'Cache write tokens:',
|
|
1576
|
+
result.usage.inputTokenDetails.cacheWriteTokens,
|
|
1577
|
+
);
|
|
1576
1578
|
```
|
|
1577
1579
|
|
|
1578
1580
|
You can also use cache control on system messages by providing multiple system messages at the head of your messages array:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/google-vertex",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.54",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"google-auth-library": "^10.5.0",
|
|
63
|
-
"@ai-sdk/anthropic": "4.0.0-beta.31",
|
|
64
63
|
"@ai-sdk/google": "4.0.0-beta.41",
|
|
65
64
|
"@ai-sdk/openai-compatible": "3.0.0-beta.27",
|
|
66
|
-
"@ai-sdk/
|
|
67
|
-
"@ai-sdk/provider-utils": "5.0.0-beta.22"
|
|
65
|
+
"@ai-sdk/anthropic": "4.0.0-beta.33",
|
|
66
|
+
"@ai-sdk/provider-utils": "5.0.0-beta.22",
|
|
67
|
+
"@ai-sdk/provider": "4.0.0-beta.12"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/node": "20.17.24",
|