Skip to content

Commit ca26fe0

Browse files
committed
AI SDK / Anthropic package updates
1 parent 0b5b1bd commit ca26fe0

6 files changed

Lines changed: 59 additions & 60 deletions

File tree

smart-spreadsheet/package-lock.json

Lines changed: 33 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

smart-spreadsheet/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
"lint": "eslint"
1010
},
1111
"dependencies": {
12-
"@ai-sdk/anthropic": "^3.0.2",
12+
"@ai-sdk/anthropic": "^2.0.57",
1313
"@radix-ui/react-slot": "^1.2.4",
1414
"@radix-ui/react-tooltip": "^1.2.8",
1515
"@supabase/ssr": "^0.8.0",
1616
"@supabase/supabase-js": "^2.89.0",
1717
"@trigger.dev/react-hooks": "^4.3.1",
1818
"@trigger.dev/sdk": "^4.3.1",
19-
"ai": "^6.0.7",
19+
"ai": "^5.0.121",
2020
"class-variance-authority": "^0.7.1",
2121
"clsx": "^2.1.1",
2222
"exa-js": "^2.0.12",

smart-spreadsheet/src/trigger/get-basic-info.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { task, metadata } from "@trigger.dev/sdk";
22
import Exa from "exa-js";
3-
import { generateText, Output } from "ai";
3+
import { generateObject } from "ai";
44
import { anthropic } from "@ai-sdk/anthropic";
55
import { z } from "zod";
66

@@ -38,7 +38,7 @@ export const getBasicInfo = task({
3838
// Get the best source URL (prefer company domains over news/wiki)
3939
const sourceUrl = results.results[0]?.url ?? null;
4040

41-
const { output } = await generateText({
41+
const { object } = await generateObject({
4242
model: anthropic("claude-sonnet-4-20250514"),
4343
prompt: `Extract the official website URL and a brief description for "${companyName}" from these search results:
4444
@@ -49,16 +49,16 @@ Instructions:
4949
2. Description: Write a VERY short tagline (10-15 words max). Example: "Cloud infrastructure for deploying and scaling applications globally."
5050
5151
If you can't find the official website in the results, ${companyUrl ? `use "${companyUrl}".` : "make your best guess based on the company name (e.g., \"https://companyname.com\")."}`,
52-
output: Output.object({ schema }),
52+
schema,
5353
});
5454

5555
// Update parent metadata for realtime streaming
56-
metadata.parent.set("website", output.website);
57-
metadata.parent.set("description", output.description);
56+
metadata.parent.set("website", object.website);
57+
metadata.parent.set("description", object.description);
5858

5959
return {
60-
website: output.website,
61-
description: output.description,
60+
website: object.website,
61+
description: object.description,
6262
sourceUrl,
6363
};
6464
},

smart-spreadsheet/src/trigger/get-employee-count.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { metadata, task } from "@trigger.dev/sdk";
22
import Exa from "exa-js";
3-
import { generateText, Output } from "ai";
3+
import { generateObject } from "ai";
44
import { anthropic } from "@ai-sdk/anthropic";
55
import { z } from "zod";
66

@@ -44,7 +44,7 @@ export const getEmployeeCount = task({
4444
// Get the best source URL
4545
const sourceUrl = results.results[0]?.url ?? null;
4646

47-
const { output } = await generateText({
47+
const { object } = await generateObject({
4848
model: anthropic("claude-sonnet-4-20250514"),
4949
prompt:
5050
`Estimate the employee count for "${companyName}" based on these search results:
@@ -54,14 +54,14 @@ ${JSON.stringify(results.results, null, 2)}
5454
Pick the closest range from: ${employeeRanges.join(", ")}
5555
5656
If you find a specific number, pick the range it falls into. If no data, estimate based on company size/stage.`,
57-
output: Output.object({ schema }),
57+
schema,
5858
});
5959

6060
// Update parent metadata for realtime streaming
61-
metadata.parent.set("employeeCount", output.employeeCount);
61+
metadata.parent.set("employeeCount", object.employeeCount);
6262

6363
return {
64-
employeeCount: output.employeeCount,
64+
employeeCount: object.employeeCount,
6565
sourceUrl,
6666
};
6767
},

smart-spreadsheet/src/trigger/get-funding-round.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { metadata, task } from "@trigger.dev/sdk";
22
import Exa from "exa-js";
3-
import { generateText, Output } from "ai";
3+
import { generateObject } from "ai";
44
import { anthropic } from "@ai-sdk/anthropic";
55
import { z } from "zod";
66

@@ -51,7 +51,7 @@ export const getFundingRound = task({
5151
// Get the best source URL
5252
const sourceUrl = results.results[0]?.url ?? null;
5353

54-
const { output } = await generateText({
54+
const { object } = await generateObject({
5555
model: anthropic("claude-sonnet-4-20250514"),
5656
prompt:
5757
`Find the latest funding round for "${companyName}" from these search results:
@@ -64,16 +64,16 @@ Extract:
6464
6565
If bootstrapped with no funding, use stage "Bootstrapped" and amount "N/A".
6666
If you can't find funding info, use stage "Unknown" and amount "N/A".`,
67-
output: Output.object({ schema }),
67+
schema,
6868
});
6969

7070
// Update parent metadata for realtime streaming
71-
metadata.parent.set("stage", output.stage);
72-
metadata.parent.set("lastRoundAmount", output.lastRoundAmount);
71+
metadata.parent.set("stage", object.stage);
72+
metadata.parent.set("lastRoundAmount", object.lastRoundAmount);
7373

7474
return {
75-
stage: output.stage,
76-
lastRoundAmount: output.lastRoundAmount,
75+
stage: object.stage,
76+
lastRoundAmount: object.lastRoundAmount,
7777
sourceUrl,
7878
};
7979
},

smart-spreadsheet/src/trigger/get-industry.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { task, metadata } from "@trigger.dev/sdk";
2-
import { generateText, Output } from "ai";
2+
import { generateObject } from "ai";
33
import { anthropic } from "@ai-sdk/anthropic";
44
import { z } from "zod";
55

@@ -21,7 +21,7 @@ export const getIndustry = task({
2121
companyName: string;
2222
companyUrl?: string | null;
2323
}) => {
24-
const { output } = await generateText({
24+
const { object } = await generateObject({
2525
model: anthropic("claude-sonnet-4-20250514"),
2626
prompt: `What industry does the company "${companyName}" operate in?
2727
@@ -36,12 +36,12 @@ Provide a concise industry classification using common categories like:
3636
- "Cloud Infrastructure"
3737
3838
If the company spans multiple industries, pick the primary one.`,
39-
output: Output.object({ schema }),
39+
schema,
4040
});
4141

4242
// Update parent metadata for realtime streaming
43-
metadata.parent.set("industry", output.industry);
43+
metadata.parent.set("industry", object.industry);
4444

45-
return output;
45+
return object;
4646
},
4747
});

0 commit comments

Comments
 (0)