Skip to content

Commit cca8007

Browse files
authored
Update ai sdk sample to 1.14.1 (#445)
* Update ai sdk sample to 1.14.1 * Update lockfile * Update dev dependency to 1.14.1
1 parent bef13a1 commit cca8007

File tree

3 files changed

+145
-160
lines changed

3 files changed

+145
-160
lines changed

ai-sdk/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "temporal-hello-world",
2+
"name": "temporal-ai-sdk",
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
@@ -23,22 +23,22 @@
2323
]
2424
},
2525
"dependencies": {
26-
"@ai-sdk/openai": "^2.0.28",
27-
"@ai-sdk/provider": "^2.0.0",
28-
"@ai-sdk/mcp": "^0.0.8",
26+
"@ai-sdk/openai": "^3.0.0",
27+
"@ai-sdk/provider": "^3.0.0",
28+
"@ai-sdk/mcp": "^1.0.0",
2929
"@modelcontextprotocol/sdk": "^1.10.2",
30-
"@temporalio/activity": "^1.14.0",
31-
"@temporalio/ai-sdk": "^1.14.0",
32-
"@temporalio/client": "^1.14.0",
33-
"@temporalio/envconfig": "^1.14.0",
34-
"@temporalio/worker": "^1.14.0",
35-
"@temporalio/workflow": "^1.14.0",
36-
"ai": "^5.0.91",
30+
"@temporalio/activity": "^1.14.1",
31+
"@temporalio/ai-sdk": "^1.14.1",
32+
"@temporalio/client": "^1.14.1",
33+
"@temporalio/envconfig": "^1.14.1",
34+
"@temporalio/worker": "^1.14.1",
35+
"@temporalio/workflow": "^1.14.1",
36+
"ai": "^6.0.0",
3737
"nanoid": "3.x",
3838
"zod": "^3.25.76"
3939
},
4040
"devDependencies": {
41-
"@temporalio/testing": "^1.14.0",
41+
"@temporalio/testing": "^1.14.1",
4242
"@tsconfig/node18": "^18.2.4",
4343
"@types/mocha": "8.x",
4444
"@types/node": "^22.9.1",

ai-sdk/src/workflows.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { TemporalMCPClient, temporalProvider } from '@temporalio/ai-sdk';
44
import type * as activities from './activities';
55
import { proxyActivities } from '@temporalio/workflow';
66
import z from 'zod';
7-
import { LanguageModelV2Middleware } from '@ai-sdk/provider';
7+
import { LanguageModelV3Middleware } from '@ai-sdk/provider';
88

99
const { getWeather } = proxyActivities<typeof activities>({
1010
startToCloseTimeout: '1 minute',
@@ -45,7 +45,8 @@ export async function toolsAgent(question: string): Promise<string> {
4545
// @@@SNIPSTART typescript-vercel-ai-sdk-middleware-agent
4646
export async function middlewareAgent(prompt: string): Promise<string> {
4747
const cache = new Map<string, any>();
48-
const middleware: LanguageModelV2Middleware = {
48+
const middleware: LanguageModelV3Middleware = {
49+
specificationVersion: 'v3',
4950
wrapGenerate: async ({ doGenerate, params }) => {
5051
const cacheKey = JSON.stringify(params);
5152
if (cache.has(cacheKey)) {

0 commit comments

Comments
 (0)