Skip to content

Commit bfe5e88

Browse files
authored
feat(node): Expand how vercel ai input/outputs can be set (#16455)
resolves #16452 Based on feedback, we want to enable attaching prompts (inputs/outputs) to vercel AI spans if `sendDefaultPii` is `true`. We also add new integration options to the Vercel AI integration that allows you to override this. ```ts export interface VercelAiOptions { /** * Enable or disable input recording. Enabled if `sendDefaultPii` is `true` * or if you set `isEnabled` to `true` in your ai SDK method telemetry settings */ recordInputs?: boolean; /** * Enable or disable output recording. Enabled if `sendDefaultPii` is `true` * or if you set `isEnabled` to `true` in your ai SDK method telemetry settings */ recordOutputs?: boolean; } ``` Usage: ```ts Sentry.vercelAIIntegration({ recordInputs: true }); ```
1 parent 45088a2 commit bfe5e88

File tree

12 files changed

+619
-349
lines changed

12 files changed

+619
-349
lines changed

dev-packages/node-integration-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@types/mongodb": "^3.6.20",
3737
"@types/mysql": "^2.15.21",
3838
"@types/pg": "^8.6.5",
39-
"ai": "^4.0.6",
39+
"ai": "^4.3.16",
4040
"amqplib": "^0.10.7",
4141
"apollo-server": "^3.11.1",
4242
"body-parser": "^1.20.3",

dev-packages/node-integration-tests/suites/tracing/ai/test.ts

Lines changed: 0 additions & 131 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as Sentry from '@sentry/node';
2+
import { loggingTransport } from '@sentry-internal/node-integration-tests';
3+
4+
Sentry.init({
5+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
6+
release: '1.0',
7+
tracesSampleRate: 1.0,
8+
sendDefaultPii: true,
9+
transport: loggingTransport,
10+
integrations: [Sentry.vercelAIIntegration()],
11+
});

dev-packages/node-integration-tests/suites/tracing/ai/instrument.mjs renamed to dev-packages/node-integration-tests/suites/tracing/vercelai/instrument.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ Sentry.init({
66
release: '1.0',
77
tracesSampleRate: 1.0,
88
transport: loggingTransport,
9+
integrations: [Sentry.vercelAIIntegration()],
910
});

0 commit comments

Comments
 (0)