Skip to content

Commit 9147c49

Browse files
author
stlc-bot
committed
feat(api): enable ZDR on remaining AI endpoints via OpenAI (#1099)
Stainless-Generated-From: 14fabea8e3536ee170db274fdd08395bdfaad25a
1 parent c5235fc commit 9147c49

8 files changed

Lines changed: 124 additions & 20 deletions

File tree

‎src/resources/ai.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,15 @@ export interface AIExtractProductParams {
461461
* timeoutOpts object.
462462
*/
463463
timeoutOpts?: AIExtractProductParams.TimeoutOpts;
464+
465+
/**
466+
* Set to enabled to bypass shared caches and omit request and response content
467+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
468+
* omitted. Requires zero data retention to be enabled for your organization
469+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
470+
* Successful ZDR responses include X-Context-ZDR: true.
471+
*/
472+
zdr?: 'enabled' | 'disabled';
464473
}
465474

466475
export namespace AIExtractProductParams {

‎src/resources/industry.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,15 @@ export interface IndustryRetrieveNaicsParams {
230230
* timeoutOpts object.
231231
*/
232232
timeoutOpts?: IndustryRetrieveNaicsParams.TimeoutOpts;
233+
234+
/**
235+
* Set to enabled to bypass shared caches and omit request and response content
236+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
237+
* omitted. Requires zero data retention to be enabled for your organization
238+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
239+
* Successful ZDR responses include X-Context-ZDR: true.
240+
*/
241+
zdr?: 'enabled' | 'disabled';
233242
}
234243

235244
export namespace IndustryRetrieveNaicsParams {
@@ -291,6 +300,15 @@ export interface IndustryRetrieveSicParams {
291300
* published by the SEC. Defaults to `original_sic`.
292301
*/
293302
type?: 'original_sic' | 'latest_sec';
303+
304+
/**
305+
* Set to enabled to bypass shared caches and omit request and response content
306+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
307+
* omitted. Requires zero data retention to be enabled for your organization
308+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
309+
* Successful ZDR responses include X-Context-ZDR: true.
310+
*/
311+
zdr?: 'enabled' | 'disabled';
294312
}
295313

296314
export namespace IndustryRetrieveSicParams {

‎src/resources/parse.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ export interface ParseHandleParams {
259259

260260
/**
261261
* Query param: Set to enabled to bypass shared caches and omit request and
262-
* response content from retained usage logs. Requires zero data retention to be
263-
* enabled for your organization (contact support@context.dev), otherwise the
264-
* request fails with ZDR_NOT_ENABLED. Successful ZDR responses include
265-
* X-Context-ZDR: true.
262+
* response content from retained usage logs. Asset uploads are skipped, so hosted
263+
* image URLs are omitted. Requires zero data retention to be enabled for your
264+
* organization (contact support@context.dev), otherwise the request fails with
265+
* ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
266266
*/
267267
zdr?: 'enabled' | 'disabled';
268268
}

‎src/resources/people.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,15 @@ export interface PersonEnrichParams {
304304
* timeoutOpts object.
305305
*/
306306
timeoutOpts?: PersonEnrichParams.TimeoutOpts;
307+
308+
/**
309+
* Set to enabled to bypass shared caches and omit request and response content
310+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
311+
* omitted. Requires zero data retention to be enabled for your organization
312+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
313+
* Successful ZDR responses include X-Context-ZDR: true.
314+
*/
315+
zdr?: 'enabled' | 'disabled';
307316
}
308317

309318
export namespace PersonEnrichParams {

‎src/resources/web.ts‎

Lines changed: 75 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2701,6 +2701,15 @@ export interface WebAnswersParams {
27012701
* timeoutOpts object.
27022702
*/
27032703
timeoutOpts?: WebAnswersParams.TimeoutOpts;
2704+
2705+
/**
2706+
* Set to enabled to bypass shared caches and omit request and response content
2707+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
2708+
* omitted. Requires zero data retention to be enabled for your organization
2709+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
2710+
* Successful ZDR responses include X-Context-ZDR: true.
2711+
*/
2712+
zdr?: 'enabled' | 'disabled';
27042713
}
27052714

27062715
export namespace WebAnswersParams {
@@ -2829,6 +2838,15 @@ export interface WebExtractParams {
28292838
* crawled page.
28302839
*/
28312840
waitForMs?: number;
2841+
2842+
/**
2843+
* Set to enabled to bypass shared caches and omit request and response content
2844+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
2845+
* omitted. Requires zero data retention to be enabled for your organization
2846+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
2847+
* Successful ZDR responses include X-Context-ZDR: true.
2848+
*/
2849+
zdr?: 'enabled' | 'disabled';
28322850
}
28332851

28342852
export namespace WebExtractParams {
@@ -2943,6 +2961,15 @@ export interface WebExtractCompetitorsParams {
29432961
* timeoutOpts object.
29442962
*/
29452963
timeoutOpts?: WebExtractCompetitorsParams.TimeoutOpts;
2964+
2965+
/**
2966+
* Set to enabled to bypass shared caches and omit request and response content
2967+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
2968+
* omitted. Requires zero data retention to be enabled for your organization
2969+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
2970+
* Successful ZDR responses include X-Context-ZDR: true.
2971+
*/
2972+
zdr?: 'enabled' | 'disabled';
29462973
}
29472974

29482975
export namespace WebExtractCompetitorsParams {
@@ -3069,6 +3096,15 @@ export interface WebExtractStyleguideParams {
30693096
* timeoutOpts object.
30703097
*/
30713098
timeoutOpts?: WebExtractStyleguideParams.TimeoutOpts;
3099+
3100+
/**
3101+
* Set to enabled to bypass shared caches and omit request and response content
3102+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
3103+
* omitted. Requires zero data retention to be enabled for your organization
3104+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
3105+
* Successful ZDR responses include X-Context-ZDR: true.
3106+
*/
3107+
zdr?: 'enabled' | 'disabled';
30723108
}
30733109

30743110
export namespace WebExtractStyleguideParams {
@@ -3403,9 +3439,10 @@ export interface WebScreenshotParams {
34033439

34043440
/**
34053441
* Set to enabled to bypass shared caches and omit request and response content
3406-
* from retained usage logs. Requires zero data retention to be enabled for your
3407-
* organization (contact support@context.dev), otherwise the request fails with
3408-
* ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
3442+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
3443+
* omitted. Requires zero data retention to be enabled for your organization
3444+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
3445+
* Successful ZDR responses include X-Context-ZDR: true.
34093446
*/
34103447
zdr?: 'enabled' | 'disabled';
34113448
}
@@ -3743,6 +3780,15 @@ export interface WebSearchParams {
37433780
* timeoutOpts object.
37443781
*/
37453782
timeoutOpts?: WebSearchParams.TimeoutOpts;
3783+
3784+
/**
3785+
* Set to enabled to bypass shared caches and omit request and response content
3786+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
3787+
* omitted. Requires zero data retention to be enabled for your organization
3788+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
3789+
* Successful ZDR responses include X-Context-ZDR: true.
3790+
*/
3791+
zdr?: 'enabled' | 'disabled';
37463792
}
37473793

37483794
export namespace WebSearchParams {
@@ -4500,9 +4546,10 @@ export interface WebWebScrapeBytesParams {
45004546

45014547
/**
45024548
* Set to enabled to bypass shared caches and omit request and response content
4503-
* from retained usage logs. Requires zero data retention to be enabled for your
4504-
* organization (contact support@context.dev), otherwise the request fails with
4505-
* ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
4549+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
4550+
* omitted. Requires zero data retention to be enabled for your organization
4551+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
4552+
* Successful ZDR responses include X-Context-ZDR: true.
45064553
*/
45074554
zdr?: 'enabled' | 'disabled';
45084555
}
@@ -4840,9 +4887,10 @@ export interface WebWebScrapeHTMLParams {
48404887

48414888
/**
48424889
* Set to enabled to bypass shared caches and omit request and response content
4843-
* from retained usage logs. Requires zero data retention to be enabled for your
4844-
* organization (contact support@context.dev), otherwise the request fails with
4845-
* ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
4890+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
4891+
* omitted. Requires zero data retention to be enabled for your organization
4892+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
4893+
* Successful ZDR responses include X-Context-ZDR: true.
48464894
*/
48474895
zdr?: 'enabled' | 'disabled';
48484896
}
@@ -5031,6 +5079,15 @@ export interface WebWebScrapeImagesParams {
50315079
* shorter deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
50325080
*/
50335081
waitForMs?: number | null;
5082+
5083+
/**
5084+
* Set to enabled to bypass shared caches and omit request and response content
5085+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
5086+
* omitted. Requires zero data retention to be enabled for your organization
5087+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
5088+
* Successful ZDR responses include X-Context-ZDR: true.
5089+
*/
5090+
zdr?: 'enabled' | 'disabled';
50345091
}
50355092

50365093
export namespace WebWebScrapeImagesParams {
@@ -5094,7 +5151,7 @@ export namespace WebWebScrapeImagesParams {
50945151

50955152
/**
50965153
* Host materializable images on the Brand.dev CDN and return their URL and MIME
5097-
* type.
5154+
* type. Ignored when zero data retention is enabled.
50985155
*/
50995156
hostedUrl?: boolean;
51005157

@@ -5456,9 +5513,10 @@ export interface WebWebScrapeMdParams {
54565513

54575514
/**
54585515
* Set to enabled to bypass shared caches and omit request and response content
5459-
* from retained usage logs. Requires zero data retention to be enabled for your
5460-
* organization (contact support@context.dev), otherwise the request fails with
5461-
* ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
5516+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
5517+
* omitted. Requires zero data retention to be enabled for your organization
5518+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
5519+
* Successful ZDR responses include X-Context-ZDR: true.
54625520
*/
54635521
zdr?: 'enabled' | 'disabled';
54645522
}
@@ -5624,9 +5682,10 @@ export interface WebWebScrapeSitemapParams {
56245682

56255683
/**
56265684
* Set to enabled to bypass shared caches and omit request and response content
5627-
* from retained usage logs. Requires zero data retention to be enabled for your
5628-
* organization (contact support@context.dev), otherwise the request fails with
5629-
* ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
5685+
* from retained usage logs. Asset uploads are skipped, so hosted image URLs are
5686+
* omitted. Requires zero data retention to be enabled for your organization
5687+
* (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
5688+
* Successful ZDR responses include X-Context-ZDR: true.
56305689
*/
56315690
zdr?: 'enabled' | 'disabled';
56325691
}

‎tests/api-resources/ai.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe('resource ai', () => {
2727
maxAgeMs: 0,
2828
tags: ['production', 'team-alpha'],
2929
timeoutOpts: { milliseconds: 1000, behavior: 'fail' },
30+
zdr: 'enabled',
3031
});
3132
});
3233

‎tests/api-resources/industry.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ describe('resource industry', () => {
2828
minResults: 1,
2929
tags: ['production', 'team-alpha'],
3030
timeoutOpts: { milliseconds: 1000, behavior: 'fail' },
31+
zdr: 'enabled',
3132
});
3233
});
3334

@@ -52,6 +53,7 @@ describe('resource industry', () => {
5253
tags: ['production', 'team-alpha'],
5354
timeoutOpts: { milliseconds: 1000, behavior: 'fail' },
5455
type: 'original_sic',
56+
zdr: 'enabled',
5557
});
5658
});
5759
});

‎tests/api-resources/web.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('resource web', () => {
3030
mode: 'fast',
3131
tags: ['production', 'team-alpha'],
3232
timeoutOpts: { milliseconds: 1000, behavior: 'fail' },
33+
zdr: 'enabled',
3334
});
3435
});
3536

@@ -81,6 +82,7 @@ describe('resource web', () => {
8182
tags: ['production', 'team-alpha'],
8283
timeoutOpts: { milliseconds: 1000, behavior: 'fail' },
8384
waitForMs: 0,
85+
zdr: 'enabled',
8486
});
8587
});
8688

@@ -103,6 +105,7 @@ describe('resource web', () => {
103105
numCompetitors: 1,
104106
tags: ['production', 'team-alpha'],
105107
timeoutOpts: { milliseconds: 1000, behavior: 'fail' },
108+
zdr: 'enabled',
106109
});
107110
});
108111

@@ -159,6 +162,7 @@ describe('resource web', () => {
159162
maxAgeMs: 0,
160163
tags: ['production', 'team-alpha'],
161164
timeoutOpts: { milliseconds: 1, behavior: 'fail' },
165+
zdr: 'enabled',
162166
},
163167
{ path: '/_stainless_unknown_path' },
164168
),
@@ -244,6 +248,7 @@ describe('resource web', () => {
244248
queryFanout: true,
245249
tags: ['production', 'team-alpha'],
246250
timeoutOpts: { milliseconds: 1000, behavior: 'fail' },
251+
zdr: 'enabled',
247252
});
248253
});
249254

@@ -383,6 +388,7 @@ describe('resource web', () => {
383388
tags: ['production', 'team-alpha'],
384389
timeoutOpts: { milliseconds: 1, behavior: 'fail' },
385390
waitForMs: 0,
391+
zdr: 'enabled',
386392
});
387393
});
388394

0 commit comments

Comments
 (0)