Skip to content

Commit 50b8528

Browse files
AbhiPrasadLms24
andauthored
feat: Document input/output options for vercel ai integration (#13933)
## DESCRIBE YOUR PR Documents getsentry/sentry-javascript#16455 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [x] Urgent deadline (GA date, etc.): June 9 (we need this to be ready by June 11, but we should merge before then) - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --------- Co-authored-by: Lukas Stracke <[email protected]>
1 parent 2808db9 commit 50b8528

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)