Skip to content

Commit ed8533f

Browse files
committed
feat: Document input/output options for vercel ai integration
1 parent fcae333 commit ed8533f

File tree

1 file changed

+39
-2
lines changed
  • docs/platforms/javascript/common/configuration/integrations

1 file changed

+39
-2
lines changed

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

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,44 @@ To enhance the spans collected by this integration, we recommend providing a `fu
4646
```javascript
4747
const result = await generateText({
4848
model: openai("gpt-4-turbo"),
49-
experimental_telemetry: { functionId: "my-awesome-function" },
49+
experimental_telemetry: {
50+
isEnabled: true,
51+
functionId: "my-awesome-function",
52+
},
53+
});
54+
```
55+
56+
## Options
57+
58+
### `recordInputs`
59+
60+
Requires SDK version `9.27.0` or higher.
61+
62+
_Type: `boolean`_
63+
64+
Records inputs to the ai function call.
65+
66+
Defaults to `true` if `sendDefaultPii` is `true` or if you explicitly set `experimental_telemetry.isEnabled` to `true` in your `ai` function callsites.
67+
68+
```javascript
69+
Sentry.init({
70+
integrations: [Sentry.vercelAIIntegration({ recordInputs: true })],
71+
});
72+
```
73+
74+
### `recordOutputs`
75+
76+
Requires SDK version `9.27.0` or higher.
77+
78+
_Type: `boolean`_
79+
80+
Records outputs to the ai function call.
81+
82+
Defaults to `true` if `sendDefaultPii` is `true` or if you explicitly set `experimental_telemetry.isEnabled` to `true` in your `ai` function callsites.
83+
84+
```javascript
85+
Sentry.init({
86+
integrations: [Sentry.vercelAIIntegration({ recordOutputs: true })],
5087
});
5188
```
5289

@@ -61,7 +98,7 @@ const result = await generateText({
6198
});
6299
```
63100

64-
If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs` to `true`.
101+
If you set `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs` it will override the default behavior of collecting inputs and outputs for that function call.
65102

66103
```javascript
67104
const result = await generateText({

0 commit comments

Comments
 (0)