Skip to content

feat: Document input/output options for vercel ai integration #13933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,44 @@ To enhance the spans collected by this integration, we recommend providing a `fu
```javascript
const result = await generateText({
model: openai("gpt-4-turbo"),
experimental_telemetry: { functionId: "my-awesome-function" },
experimental_telemetry: {
isEnabled: true,
functionId: "my-awesome-function",
},
});
```

## Options

### `recordInputs`

Requires SDK version `9.27.0` or higher.

_Type: `boolean`_

Records inputs to the `ai` function call.

Defaults to `true` if `sendDefaultPii` is `true` or if you explicitly set `experimental_telemetry.isEnabled` to `true` in your `ai` function callsites.

```javascript
Sentry.init({
integrations: [Sentry.vercelAIIntegration({ recordInputs: true })],
});
```

### `recordOutputs`

Requires SDK version `9.27.0` or higher.

_Type: `boolean`_

Records outputs to the `ai` function call.

Defaults to `true` if `sendDefaultPii` is `true` or if you explicitly set `experimental_telemetry.isEnabled` to `true` in your `ai` function callsites.

```javascript
Sentry.init({
integrations: [Sentry.vercelAIIntegration({ recordOutputs: true })],
});
```

Expand All @@ -61,7 +98,7 @@ const result = await generateText({
});
```

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`.
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.

```javascript
const result = await generateText({
Expand Down
Loading