Skip to content

Commit 5565956

Browse files
obostjancicbitsandfoxes
authored andcommitted
feat(vercelai): include input/output options (#14067)
1 parent a1bb076 commit 5565956

File tree

1 file changed

+12
-6
lines changed
  • docs/platforms/javascript/common/configuration/integrations

1 file changed

+12
-6
lines changed

docs/platforms/javascript/common/configuration/integrations/vercelai.mdx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,31 @@ supported:
2727

2828
<Alert>
2929

30-
This integration only works in the Node.js and Bun runtimes. Requires SDK version `8.43.0` or higher.
30+
This integration only works in the Node.js and Bun runtimes. Requires SDK version `9.30.0` or higher.
3131

3232
</Alert>
3333

3434
_Import name: `Sentry.vercelAIIntegration`_
3535

36-
The `vercelAIIntegration` adds instrumentation for the [`ai`](https://www.npmjs.com/package/ai) library by Vercel to capture spans using the [`AI SDK's built-in Telemetry`](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
36+
The `vercelAIIntegration` adds instrumentation for the [`ai`](https://www.npmjs.com/package/ai) SDK by Vercel to capture spans using the [`AI SDK's built-in Telemetry`](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry). Get started with the following snippet:
3737

3838
```javascript
3939
Sentry.init({
40-
integrations: [Sentry.vercelAIIntegration()],
40+
tracesSampleRate: 1.0,
41+
integrations: [
42+
Sentry.vercelAIIntegration({
43+
recordInputs: true,
44+
recordOutputs: true,
45+
}),
46+
],
4147
});
4248
```
4349

4450
To enhance the spans collected by this integration, we recommend providing a `functionId` to identify the function that the telemetry data is for. For more details, see the [AI SDK Telemetry Metadata docs](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry#telemetry-metadata).
4551

4652
```javascript
4753
const result = await generateText({
48-
model: openai("gpt-4-turbo"),
54+
model: openai("gpt-4o"),
4955
experimental_telemetry: {
5056
isEnabled: true,
5157
functionId: "my-awesome-function",
@@ -93,7 +99,7 @@ By default this integration adds tracing support to all `ai` function callsites.
9399

94100
```javascript
95101
const result = await generateText({
96-
model: openai("gpt-4-turbo"),
102+
model: openai("gpt-4o"),
97103
experimental_telemetry: { isEnabled: false },
98104
});
99105
```
@@ -102,7 +108,7 @@ If you set `experimental_telemetry.recordInputs` and `experimental_telemetry.rec
102108

103109
```javascript
104110
const result = await generateText({
105-
model: openai("gpt-4-turbo"),
111+
model: openai("gpt-4o"),
106112
experimental_telemetry: {
107113
isEnabled: true,
108114
recordInputs: true,

0 commit comments

Comments
 (0)