@openrouter/sdk 0.0.0-beta.32 → 0.0.0-beta.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FUNCTIONS.md +2 -0
- package/REACT_QUERY.md +2 -0
- package/README.md +12 -0
- package/dist/commonjs/funcs/endpointsList.d.ts +1 -1
- package/dist/commonjs/funcs/endpointsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/endpointsList.js +1 -1
- package/dist/commonjs/funcs/endpointsList.js.map +1 -1
- package/dist/commonjs/funcs/modelsList.d.ts +1 -1
- package/dist/commonjs/funcs/modelsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/modelsList.js +1 -1
- package/dist/commonjs/funcs/modelsList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/endpointslist.d.ts +768 -0
- package/dist/commonjs/models/endpointslist.d.ts.map +1 -0
- package/dist/commonjs/models/endpointslist.js +625 -0
- package/dist/commonjs/models/endpointslist.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +3 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +3 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/keyinfo.d.ts +155 -0
- package/dist/commonjs/models/keyinfo.d.ts.map +1 -0
- package/dist/commonjs/models/keyinfo.js +163 -0
- package/dist/commonjs/models/keyinfo.js.map +1 -0
- package/dist/commonjs/models/modelslist.d.ts +854 -0
- package/dist/commonjs/models/modelslist.d.ts.map +1 -0
- package/dist/commonjs/models/modelslist.js +768 -0
- package/dist/commonjs/models/modelslist.js.map +1 -0
- package/dist/commonjs/models/openairesponsesrequest.d.ts +52 -52
- package/dist/commonjs/models/openairesponsesrequest.d.ts.map +1 -1
- package/dist/commonjs/models/openairesponsesrequest.js +74 -76
- package/dist/commonjs/models/openairesponsesrequest.js.map +1 -1
- package/dist/commonjs/models/operations/getcurrentkey.d.ts +3 -108
- package/dist/commonjs/models/operations/getcurrentkey.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getcurrentkey.js +4 -88
- package/dist/commonjs/models/operations/getcurrentkey.js.map +1 -1
- package/dist/commonjs/models/operations/list.d.ts +63 -825
- package/dist/commonjs/models/operations/list.d.ts.map +1 -1
- package/dist/commonjs/models/operations/list.js +86 -667
- package/dist/commonjs/models/operations/list.js.map +1 -1
- package/dist/commonjs/models/operations/listmodels.d.ts +16 -865
- package/dist/commonjs/models/operations/listmodels.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listmodels.js +19 -742
- package/dist/commonjs/models/operations/listmodels.js.map +1 -1
- package/dist/commonjs/models/operations/listusermodels.d.ts +3 -852
- package/dist/commonjs/models/operations/listusermodels.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listusermodels.js +4 -730
- package/dist/commonjs/models/operations/listusermodels.js.map +1 -1
- package/dist/commonjs/models/operations/previewzdr.d.ts +97 -97
- package/dist/commonjs/models/operations/previewzdr.d.ts.map +1 -1
- package/dist/commonjs/models/operations/previewzdr.js +134 -133
- package/dist/commonjs/models/operations/previewzdr.js.map +1 -1
- package/dist/commonjs/models/responsereasoningconfig.d.ts +4 -0
- package/dist/commonjs/models/responsereasoningconfig.d.ts.map +1 -1
- package/dist/commonjs/models/responsereasoningconfig.js +13 -0
- package/dist/commonjs/models/responsereasoningconfig.js.map +1 -1
- package/dist/commonjs/models/responsesusage.d.ts +41 -0
- package/dist/commonjs/models/responsesusage.d.ts.map +1 -1
- package/dist/commonjs/models/responsesusage.js +54 -1
- package/dist/commonjs/models/responsesusage.js.map +1 -1
- package/dist/commonjs/react-query/endpointsList.d.ts +4 -4
- package/dist/commonjs/react-query/endpointsList.d.ts.map +1 -1
- package/dist/commonjs/react-query/endpointsList.js.map +1 -1
- package/dist/commonjs/react-query/modelsList.d.ts +4 -4
- package/dist/commonjs/react-query/modelsList.d.ts.map +1 -1
- package/dist/commonjs/react-query/modelsList.js.map +1 -1
- package/dist/commonjs/sdk/endpoints.d.ts +1 -1
- package/dist/commonjs/sdk/endpoints.d.ts.map +1 -1
- package/dist/commonjs/sdk/endpoints.js.map +1 -1
- package/dist/commonjs/sdk/models.d.ts +1 -1
- package/dist/commonjs/sdk/models.d.ts.map +1 -1
- package/dist/commonjs/sdk/models.js.map +1 -1
- package/dist/esm/funcs/endpointsList.d.ts +1 -1
- package/dist/esm/funcs/endpointsList.d.ts.map +1 -1
- package/dist/esm/funcs/endpointsList.js +1 -1
- package/dist/esm/funcs/endpointsList.js.map +1 -1
- package/dist/esm/funcs/modelsList.d.ts +1 -1
- package/dist/esm/funcs/modelsList.d.ts.map +1 -1
- package/dist/esm/funcs/modelsList.js +1 -1
- package/dist/esm/funcs/modelsList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/endpointslist.d.ts +768 -0
- package/dist/esm/models/endpointslist.d.ts.map +1 -0
- package/dist/esm/models/endpointslist.js +562 -0
- package/dist/esm/models/endpointslist.js.map +1 -0
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +3 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/keyinfo.d.ts +155 -0
- package/dist/esm/models/keyinfo.d.ts.map +1 -0
- package/dist/esm/models/keyinfo.js +123 -0
- package/dist/esm/models/keyinfo.js.map +1 -0
- package/dist/esm/models/modelslist.d.ts +854 -0
- package/dist/esm/models/modelslist.d.ts.map +1 -0
- package/dist/esm/models/modelslist.js +697 -0
- package/dist/esm/models/modelslist.js.map +1 -0
- package/dist/esm/models/openairesponsesrequest.d.ts +52 -52
- package/dist/esm/models/openairesponsesrequest.d.ts.map +1 -1
- package/dist/esm/models/openairesponsesrequest.js +64 -66
- package/dist/esm/models/openairesponsesrequest.js.map +1 -1
- package/dist/esm/models/operations/getcurrentkey.d.ts +3 -108
- package/dist/esm/models/operations/getcurrentkey.d.ts.map +1 -1
- package/dist/esm/models/operations/getcurrentkey.js +3 -83
- package/dist/esm/models/operations/getcurrentkey.js.map +1 -1
- package/dist/esm/models/operations/list.d.ts +63 -825
- package/dist/esm/models/operations/list.d.ts.map +1 -1
- package/dist/esm/models/operations/list.js +81 -635
- package/dist/esm/models/operations/list.js.map +1 -1
- package/dist/esm/models/operations/listmodels.d.ts +16 -865
- package/dist/esm/models/operations/listmodels.d.ts.map +1 -1
- package/dist/esm/models/operations/listmodels.js +16 -704
- package/dist/esm/models/operations/listmodels.js.map +1 -1
- package/dist/esm/models/operations/listusermodels.d.ts +3 -852
- package/dist/esm/models/operations/listusermodels.d.ts.map +1 -1
- package/dist/esm/models/operations/listusermodels.js +3 -694
- package/dist/esm/models/operations/listusermodels.js.map +1 -1
- package/dist/esm/models/operations/previewzdr.d.ts +97 -97
- package/dist/esm/models/operations/previewzdr.d.ts.map +1 -1
- package/dist/esm/models/operations/previewzdr.js +118 -117
- package/dist/esm/models/operations/previewzdr.js.map +1 -1
- package/dist/esm/models/responsereasoningconfig.d.ts +4 -0
- package/dist/esm/models/responsereasoningconfig.d.ts.map +1 -1
- package/dist/esm/models/responsereasoningconfig.js +13 -0
- package/dist/esm/models/responsereasoningconfig.js.map +1 -1
- package/dist/esm/models/responsesusage.d.ts +41 -0
- package/dist/esm/models/responsesusage.d.ts.map +1 -1
- package/dist/esm/models/responsesusage.js +51 -0
- package/dist/esm/models/responsesusage.js.map +1 -1
- package/dist/esm/react-query/endpointsList.d.ts +4 -4
- package/dist/esm/react-query/endpointsList.d.ts.map +1 -1
- package/dist/esm/react-query/endpointsList.js.map +1 -1
- package/dist/esm/react-query/modelsList.d.ts +4 -4
- package/dist/esm/react-query/modelsList.d.ts.map +1 -1
- package/dist/esm/react-query/modelsList.js.map +1 -1
- package/dist/esm/sdk/endpoints.d.ts +1 -1
- package/dist/esm/sdk/endpoints.d.ts.map +1 -1
- package/dist/esm/sdk/endpoints.js.map +1 -1
- package/dist/esm/sdk/models.d.ts +1 -1
- package/dist/esm/sdk/models.d.ts.map +1 -1
- package/dist/esm/sdk/models.js.map +1 -1
- package/docs/sdks/endpoints/README.md +1 -1
- package/docs/sdks/models/README.md +1 -1
- package/docs/sdks/responses/README.md +4 -0
- package/examples/betaResponsesSendRequest.example.ts +2 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/endpointsList.ts +3 -3
- package/src/funcs/modelsList.ts +3 -5
- package/src/lib/config.ts +2 -2
- package/src/models/endpointslist.ts +1034 -0
- package/src/models/index.ts +3 -0
- package/src/models/keyinfo.ts +281 -0
- package/src/models/modelslist.ts +1394 -0
- package/src/models/openairesponsesrequest.ts +133 -94
- package/src/models/operations/getcurrentkey.ts +5 -203
- package/src/models/operations/list.ts +109 -1106
- package/src/models/operations/listmodels.ts +26 -1436
- package/src/models/operations/listusermodels.ts +5 -1440
- package/src/models/operations/previewzdr.ts +196 -225
- package/src/models/responsereasoningconfig.ts +17 -0
- package/src/models/responsesusage.ts +96 -0
- package/src/react-query/endpointsList.ts +4 -4
- package/src/react-query/modelsList.ts +4 -4
- package/src/sdk/endpoints.ts +1 -1
- package/src/sdk/models.ts +1 -1
|
@@ -17,21 +17,21 @@ export type EndpointsPreviewZDRRequest = number | string | any;
|
|
|
17
17
|
|
|
18
18
|
export type PreviewZDRImage = number | string | any;
|
|
19
19
|
|
|
20
|
-
export type
|
|
20
|
+
export type ImageOutput = number | string | any;
|
|
21
21
|
|
|
22
22
|
export type PreviewZDRAudio = number | string | any;
|
|
23
23
|
|
|
24
|
-
export type
|
|
24
|
+
export type InputAudioCache = number | string | any;
|
|
25
25
|
|
|
26
|
-
export type
|
|
26
|
+
export type WebSearch = number | string | any;
|
|
27
27
|
|
|
28
|
-
export type
|
|
28
|
+
export type InternalReasoning = number | string | any;
|
|
29
29
|
|
|
30
|
-
export type
|
|
30
|
+
export type InputCacheRead = number | string | any;
|
|
31
31
|
|
|
32
|
-
export type
|
|
32
|
+
export type InputCacheWrite = number | string | any;
|
|
33
33
|
|
|
34
|
-
export type
|
|
34
|
+
export type Pricing = {
|
|
35
35
|
prompt?: number | string | any | undefined;
|
|
36
36
|
completion?: number | string | any | undefined;
|
|
37
37
|
request?: number | string | any | undefined;
|
|
@@ -46,7 +46,7 @@ export type PreviewZDRPricing = {
|
|
|
46
46
|
discount?: number | undefined;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
export const
|
|
49
|
+
export const ProviderName = {
|
|
50
50
|
AnyScale: "AnyScale",
|
|
51
51
|
CentML: "Cent-ML",
|
|
52
52
|
HuggingFace: "HuggingFace",
|
|
@@ -130,7 +130,7 @@ export const PreviewZDRProviderName = {
|
|
|
130
130
|
ZAi: "Z.AI",
|
|
131
131
|
FakeProvider: "FakeProvider",
|
|
132
132
|
} as const;
|
|
133
|
-
export type
|
|
133
|
+
export type ProviderName = ClosedEnum<typeof ProviderName>;
|
|
134
134
|
|
|
135
135
|
export const PreviewZDRQuantization = {
|
|
136
136
|
Int4: "int4",
|
|
@@ -174,7 +174,7 @@ export type PreviewZDRSupportedParameter = ClosedEnum<
|
|
|
174
174
|
typeof PreviewZDRSupportedParameter
|
|
175
175
|
>;
|
|
176
176
|
|
|
177
|
-
export const
|
|
177
|
+
export const Status = {
|
|
178
178
|
Zero: 0,
|
|
179
179
|
Minus1: -1,
|
|
180
180
|
Minus2: -2,
|
|
@@ -182,20 +182,20 @@ export const PreviewZDRStatus = {
|
|
|
182
182
|
Minus5: -5,
|
|
183
183
|
Minus10: -10,
|
|
184
184
|
} as const;
|
|
185
|
-
export type
|
|
185
|
+
export type Status = ClosedEnum<typeof Status>;
|
|
186
186
|
|
|
187
187
|
export type PreviewZDRData = {
|
|
188
188
|
name: string;
|
|
189
189
|
modelName: string;
|
|
190
190
|
contextLength: number;
|
|
191
|
-
pricing:
|
|
192
|
-
providerName:
|
|
191
|
+
pricing: Pricing;
|
|
192
|
+
providerName: ProviderName;
|
|
193
193
|
tag: string;
|
|
194
194
|
quantization: PreviewZDRQuantization | null;
|
|
195
195
|
maxCompletionTokens: number | null;
|
|
196
196
|
maxPromptTokens: number | null;
|
|
197
197
|
supportedParameters: Array<PreviewZDRSupportedParameter>;
|
|
198
|
-
status?:
|
|
198
|
+
status?: Status | undefined;
|
|
199
199
|
uptimeLast30m: number | null;
|
|
200
200
|
supportsImplicitCaching: boolean;
|
|
201
201
|
};
|
|
@@ -398,50 +398,46 @@ export function previewZDRImageFromJSON(
|
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
/** @internal */
|
|
401
|
-
export const
|
|
402
|
-
|
|
401
|
+
export const ImageOutput$inboundSchema: z.ZodType<
|
|
402
|
+
ImageOutput,
|
|
403
403
|
z.ZodTypeDef,
|
|
404
404
|
unknown
|
|
405
405
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
406
406
|
|
|
407
407
|
/** @internal */
|
|
408
|
-
export type
|
|
408
|
+
export type ImageOutput$Outbound = number | string | any;
|
|
409
409
|
|
|
410
410
|
/** @internal */
|
|
411
|
-
export const
|
|
412
|
-
|
|
411
|
+
export const ImageOutput$outboundSchema: z.ZodType<
|
|
412
|
+
ImageOutput$Outbound,
|
|
413
413
|
z.ZodTypeDef,
|
|
414
|
-
|
|
414
|
+
ImageOutput
|
|
415
415
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
416
416
|
|
|
417
417
|
/**
|
|
418
418
|
* @internal
|
|
419
419
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
420
420
|
*/
|
|
421
|
-
export namespace
|
|
422
|
-
/** @deprecated use `
|
|
423
|
-
export const inboundSchema =
|
|
424
|
-
/** @deprecated use `
|
|
425
|
-
export const outboundSchema =
|
|
426
|
-
/** @deprecated use `
|
|
427
|
-
export type Outbound =
|
|
421
|
+
export namespace ImageOutput$ {
|
|
422
|
+
/** @deprecated use `ImageOutput$inboundSchema` instead. */
|
|
423
|
+
export const inboundSchema = ImageOutput$inboundSchema;
|
|
424
|
+
/** @deprecated use `ImageOutput$outboundSchema` instead. */
|
|
425
|
+
export const outboundSchema = ImageOutput$outboundSchema;
|
|
426
|
+
/** @deprecated use `ImageOutput$Outbound` instead. */
|
|
427
|
+
export type Outbound = ImageOutput$Outbound;
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
-
export function
|
|
431
|
-
|
|
432
|
-
): string {
|
|
433
|
-
return JSON.stringify(
|
|
434
|
-
PreviewZDRImageOutput$outboundSchema.parse(previewZDRImageOutput),
|
|
435
|
-
);
|
|
430
|
+
export function imageOutputToJSON(imageOutput: ImageOutput): string {
|
|
431
|
+
return JSON.stringify(ImageOutput$outboundSchema.parse(imageOutput));
|
|
436
432
|
}
|
|
437
433
|
|
|
438
|
-
export function
|
|
434
|
+
export function imageOutputFromJSON(
|
|
439
435
|
jsonString: string,
|
|
440
|
-
): SafeParseResult<
|
|
436
|
+
): SafeParseResult<ImageOutput, SDKValidationError> {
|
|
441
437
|
return safeParse(
|
|
442
438
|
jsonString,
|
|
443
|
-
(x) =>
|
|
444
|
-
`Failed to parse '
|
|
439
|
+
(x) => ImageOutput$inboundSchema.parse(JSON.parse(x)),
|
|
440
|
+
`Failed to parse 'ImageOutput' from JSON`,
|
|
445
441
|
);
|
|
446
442
|
}
|
|
447
443
|
|
|
@@ -492,278 +488,261 @@ export function previewZDRAudioFromJSON(
|
|
|
492
488
|
}
|
|
493
489
|
|
|
494
490
|
/** @internal */
|
|
495
|
-
export const
|
|
496
|
-
|
|
491
|
+
export const InputAudioCache$inboundSchema: z.ZodType<
|
|
492
|
+
InputAudioCache,
|
|
497
493
|
z.ZodTypeDef,
|
|
498
494
|
unknown
|
|
499
495
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
500
496
|
|
|
501
497
|
/** @internal */
|
|
502
|
-
export type
|
|
498
|
+
export type InputAudioCache$Outbound = number | string | any;
|
|
503
499
|
|
|
504
500
|
/** @internal */
|
|
505
|
-
export const
|
|
506
|
-
|
|
501
|
+
export const InputAudioCache$outboundSchema: z.ZodType<
|
|
502
|
+
InputAudioCache$Outbound,
|
|
507
503
|
z.ZodTypeDef,
|
|
508
|
-
|
|
504
|
+
InputAudioCache
|
|
509
505
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
510
506
|
|
|
511
507
|
/**
|
|
512
508
|
* @internal
|
|
513
509
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
514
510
|
*/
|
|
515
|
-
export namespace
|
|
516
|
-
/** @deprecated use `
|
|
517
|
-
export const inboundSchema =
|
|
518
|
-
/** @deprecated use `
|
|
519
|
-
export const outboundSchema =
|
|
520
|
-
/** @deprecated use `
|
|
521
|
-
export type Outbound =
|
|
511
|
+
export namespace InputAudioCache$ {
|
|
512
|
+
/** @deprecated use `InputAudioCache$inboundSchema` instead. */
|
|
513
|
+
export const inboundSchema = InputAudioCache$inboundSchema;
|
|
514
|
+
/** @deprecated use `InputAudioCache$outboundSchema` instead. */
|
|
515
|
+
export const outboundSchema = InputAudioCache$outboundSchema;
|
|
516
|
+
/** @deprecated use `InputAudioCache$Outbound` instead. */
|
|
517
|
+
export type Outbound = InputAudioCache$Outbound;
|
|
522
518
|
}
|
|
523
519
|
|
|
524
|
-
export function
|
|
525
|
-
|
|
520
|
+
export function inputAudioCacheToJSON(
|
|
521
|
+
inputAudioCache: InputAudioCache,
|
|
526
522
|
): string {
|
|
527
|
-
return JSON.stringify(
|
|
528
|
-
PreviewZDRInputAudioCache$outboundSchema.parse(previewZDRInputAudioCache),
|
|
529
|
-
);
|
|
523
|
+
return JSON.stringify(InputAudioCache$outboundSchema.parse(inputAudioCache));
|
|
530
524
|
}
|
|
531
525
|
|
|
532
|
-
export function
|
|
526
|
+
export function inputAudioCacheFromJSON(
|
|
533
527
|
jsonString: string,
|
|
534
|
-
): SafeParseResult<
|
|
528
|
+
): SafeParseResult<InputAudioCache, SDKValidationError> {
|
|
535
529
|
return safeParse(
|
|
536
530
|
jsonString,
|
|
537
|
-
(x) =>
|
|
538
|
-
`Failed to parse '
|
|
531
|
+
(x) => InputAudioCache$inboundSchema.parse(JSON.parse(x)),
|
|
532
|
+
`Failed to parse 'InputAudioCache' from JSON`,
|
|
539
533
|
);
|
|
540
534
|
}
|
|
541
535
|
|
|
542
536
|
/** @internal */
|
|
543
|
-
export const
|
|
544
|
-
|
|
537
|
+
export const WebSearch$inboundSchema: z.ZodType<
|
|
538
|
+
WebSearch,
|
|
545
539
|
z.ZodTypeDef,
|
|
546
540
|
unknown
|
|
547
541
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
548
542
|
|
|
549
543
|
/** @internal */
|
|
550
|
-
export type
|
|
544
|
+
export type WebSearch$Outbound = number | string | any;
|
|
551
545
|
|
|
552
546
|
/** @internal */
|
|
553
|
-
export const
|
|
554
|
-
|
|
547
|
+
export const WebSearch$outboundSchema: z.ZodType<
|
|
548
|
+
WebSearch$Outbound,
|
|
555
549
|
z.ZodTypeDef,
|
|
556
|
-
|
|
550
|
+
WebSearch
|
|
557
551
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
558
552
|
|
|
559
553
|
/**
|
|
560
554
|
* @internal
|
|
561
555
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
562
556
|
*/
|
|
563
|
-
export namespace
|
|
564
|
-
/** @deprecated use `
|
|
565
|
-
export const inboundSchema =
|
|
566
|
-
/** @deprecated use `
|
|
567
|
-
export const outboundSchema =
|
|
568
|
-
/** @deprecated use `
|
|
569
|
-
export type Outbound =
|
|
557
|
+
export namespace WebSearch$ {
|
|
558
|
+
/** @deprecated use `WebSearch$inboundSchema` instead. */
|
|
559
|
+
export const inboundSchema = WebSearch$inboundSchema;
|
|
560
|
+
/** @deprecated use `WebSearch$outboundSchema` instead. */
|
|
561
|
+
export const outboundSchema = WebSearch$outboundSchema;
|
|
562
|
+
/** @deprecated use `WebSearch$Outbound` instead. */
|
|
563
|
+
export type Outbound = WebSearch$Outbound;
|
|
570
564
|
}
|
|
571
565
|
|
|
572
|
-
export function
|
|
573
|
-
|
|
574
|
-
): string {
|
|
575
|
-
return JSON.stringify(
|
|
576
|
-
PreviewZDRWebSearch$outboundSchema.parse(previewZDRWebSearch),
|
|
577
|
-
);
|
|
566
|
+
export function webSearchToJSON(webSearch: WebSearch): string {
|
|
567
|
+
return JSON.stringify(WebSearch$outboundSchema.parse(webSearch));
|
|
578
568
|
}
|
|
579
569
|
|
|
580
|
-
export function
|
|
570
|
+
export function webSearchFromJSON(
|
|
581
571
|
jsonString: string,
|
|
582
|
-
): SafeParseResult<
|
|
572
|
+
): SafeParseResult<WebSearch, SDKValidationError> {
|
|
583
573
|
return safeParse(
|
|
584
574
|
jsonString,
|
|
585
|
-
(x) =>
|
|
586
|
-
`Failed to parse '
|
|
575
|
+
(x) => WebSearch$inboundSchema.parse(JSON.parse(x)),
|
|
576
|
+
`Failed to parse 'WebSearch' from JSON`,
|
|
587
577
|
);
|
|
588
578
|
}
|
|
589
579
|
|
|
590
580
|
/** @internal */
|
|
591
|
-
export const
|
|
592
|
-
|
|
581
|
+
export const InternalReasoning$inboundSchema: z.ZodType<
|
|
582
|
+
InternalReasoning,
|
|
593
583
|
z.ZodTypeDef,
|
|
594
584
|
unknown
|
|
595
585
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
596
586
|
|
|
597
587
|
/** @internal */
|
|
598
|
-
export type
|
|
588
|
+
export type InternalReasoning$Outbound = number | string | any;
|
|
599
589
|
|
|
600
590
|
/** @internal */
|
|
601
|
-
export const
|
|
602
|
-
|
|
591
|
+
export const InternalReasoning$outboundSchema: z.ZodType<
|
|
592
|
+
InternalReasoning$Outbound,
|
|
603
593
|
z.ZodTypeDef,
|
|
604
|
-
|
|
594
|
+
InternalReasoning
|
|
605
595
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
606
596
|
|
|
607
597
|
/**
|
|
608
598
|
* @internal
|
|
609
599
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
610
600
|
*/
|
|
611
|
-
export namespace
|
|
612
|
-
/** @deprecated use `
|
|
613
|
-
export const inboundSchema =
|
|
614
|
-
/** @deprecated use `
|
|
615
|
-
export const outboundSchema =
|
|
616
|
-
/** @deprecated use `
|
|
617
|
-
export type Outbound =
|
|
601
|
+
export namespace InternalReasoning$ {
|
|
602
|
+
/** @deprecated use `InternalReasoning$inboundSchema` instead. */
|
|
603
|
+
export const inboundSchema = InternalReasoning$inboundSchema;
|
|
604
|
+
/** @deprecated use `InternalReasoning$outboundSchema` instead. */
|
|
605
|
+
export const outboundSchema = InternalReasoning$outboundSchema;
|
|
606
|
+
/** @deprecated use `InternalReasoning$Outbound` instead. */
|
|
607
|
+
export type Outbound = InternalReasoning$Outbound;
|
|
618
608
|
}
|
|
619
609
|
|
|
620
|
-
export function
|
|
621
|
-
|
|
610
|
+
export function internalReasoningToJSON(
|
|
611
|
+
internalReasoning: InternalReasoning,
|
|
622
612
|
): string {
|
|
623
613
|
return JSON.stringify(
|
|
624
|
-
|
|
625
|
-
previewZDRInternalReasoning,
|
|
626
|
-
),
|
|
614
|
+
InternalReasoning$outboundSchema.parse(internalReasoning),
|
|
627
615
|
);
|
|
628
616
|
}
|
|
629
617
|
|
|
630
|
-
export function
|
|
618
|
+
export function internalReasoningFromJSON(
|
|
631
619
|
jsonString: string,
|
|
632
|
-
): SafeParseResult<
|
|
620
|
+
): SafeParseResult<InternalReasoning, SDKValidationError> {
|
|
633
621
|
return safeParse(
|
|
634
622
|
jsonString,
|
|
635
|
-
(x) =>
|
|
636
|
-
`Failed to parse '
|
|
623
|
+
(x) => InternalReasoning$inboundSchema.parse(JSON.parse(x)),
|
|
624
|
+
`Failed to parse 'InternalReasoning' from JSON`,
|
|
637
625
|
);
|
|
638
626
|
}
|
|
639
627
|
|
|
640
628
|
/** @internal */
|
|
641
|
-
export const
|
|
642
|
-
|
|
629
|
+
export const InputCacheRead$inboundSchema: z.ZodType<
|
|
630
|
+
InputCacheRead,
|
|
643
631
|
z.ZodTypeDef,
|
|
644
632
|
unknown
|
|
645
633
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
646
634
|
|
|
647
635
|
/** @internal */
|
|
648
|
-
export type
|
|
636
|
+
export type InputCacheRead$Outbound = number | string | any;
|
|
649
637
|
|
|
650
638
|
/** @internal */
|
|
651
|
-
export const
|
|
652
|
-
|
|
639
|
+
export const InputCacheRead$outboundSchema: z.ZodType<
|
|
640
|
+
InputCacheRead$Outbound,
|
|
653
641
|
z.ZodTypeDef,
|
|
654
|
-
|
|
642
|
+
InputCacheRead
|
|
655
643
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
656
644
|
|
|
657
645
|
/**
|
|
658
646
|
* @internal
|
|
659
647
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
660
648
|
*/
|
|
661
|
-
export namespace
|
|
662
|
-
/** @deprecated use `
|
|
663
|
-
export const inboundSchema =
|
|
664
|
-
/** @deprecated use `
|
|
665
|
-
export const outboundSchema =
|
|
666
|
-
/** @deprecated use `
|
|
667
|
-
export type Outbound =
|
|
649
|
+
export namespace InputCacheRead$ {
|
|
650
|
+
/** @deprecated use `InputCacheRead$inboundSchema` instead. */
|
|
651
|
+
export const inboundSchema = InputCacheRead$inboundSchema;
|
|
652
|
+
/** @deprecated use `InputCacheRead$outboundSchema` instead. */
|
|
653
|
+
export const outboundSchema = InputCacheRead$outboundSchema;
|
|
654
|
+
/** @deprecated use `InputCacheRead$Outbound` instead. */
|
|
655
|
+
export type Outbound = InputCacheRead$Outbound;
|
|
668
656
|
}
|
|
669
657
|
|
|
670
|
-
export function
|
|
671
|
-
|
|
672
|
-
): string {
|
|
673
|
-
return JSON.stringify(
|
|
674
|
-
PreviewZDRInputCacheRead$outboundSchema.parse(previewZDRInputCacheRead),
|
|
675
|
-
);
|
|
658
|
+
export function inputCacheReadToJSON(inputCacheRead: InputCacheRead): string {
|
|
659
|
+
return JSON.stringify(InputCacheRead$outboundSchema.parse(inputCacheRead));
|
|
676
660
|
}
|
|
677
661
|
|
|
678
|
-
export function
|
|
662
|
+
export function inputCacheReadFromJSON(
|
|
679
663
|
jsonString: string,
|
|
680
|
-
): SafeParseResult<
|
|
664
|
+
): SafeParseResult<InputCacheRead, SDKValidationError> {
|
|
681
665
|
return safeParse(
|
|
682
666
|
jsonString,
|
|
683
|
-
(x) =>
|
|
684
|
-
`Failed to parse '
|
|
667
|
+
(x) => InputCacheRead$inboundSchema.parse(JSON.parse(x)),
|
|
668
|
+
`Failed to parse 'InputCacheRead' from JSON`,
|
|
685
669
|
);
|
|
686
670
|
}
|
|
687
671
|
|
|
688
672
|
/** @internal */
|
|
689
|
-
export const
|
|
690
|
-
|
|
673
|
+
export const InputCacheWrite$inboundSchema: z.ZodType<
|
|
674
|
+
InputCacheWrite,
|
|
691
675
|
z.ZodTypeDef,
|
|
692
676
|
unknown
|
|
693
677
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
694
678
|
|
|
695
679
|
/** @internal */
|
|
696
|
-
export type
|
|
680
|
+
export type InputCacheWrite$Outbound = number | string | any;
|
|
697
681
|
|
|
698
682
|
/** @internal */
|
|
699
|
-
export const
|
|
700
|
-
|
|
683
|
+
export const InputCacheWrite$outboundSchema: z.ZodType<
|
|
684
|
+
InputCacheWrite$Outbound,
|
|
701
685
|
z.ZodTypeDef,
|
|
702
|
-
|
|
686
|
+
InputCacheWrite
|
|
703
687
|
> = z.union([z.number(), z.string(), z.any()]);
|
|
704
688
|
|
|
705
689
|
/**
|
|
706
690
|
* @internal
|
|
707
691
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
708
692
|
*/
|
|
709
|
-
export namespace
|
|
710
|
-
/** @deprecated use `
|
|
711
|
-
export const inboundSchema =
|
|
712
|
-
/** @deprecated use `
|
|
713
|
-
export const outboundSchema =
|
|
714
|
-
/** @deprecated use `
|
|
715
|
-
export type Outbound =
|
|
693
|
+
export namespace InputCacheWrite$ {
|
|
694
|
+
/** @deprecated use `InputCacheWrite$inboundSchema` instead. */
|
|
695
|
+
export const inboundSchema = InputCacheWrite$inboundSchema;
|
|
696
|
+
/** @deprecated use `InputCacheWrite$outboundSchema` instead. */
|
|
697
|
+
export const outboundSchema = InputCacheWrite$outboundSchema;
|
|
698
|
+
/** @deprecated use `InputCacheWrite$Outbound` instead. */
|
|
699
|
+
export type Outbound = InputCacheWrite$Outbound;
|
|
716
700
|
}
|
|
717
701
|
|
|
718
|
-
export function
|
|
719
|
-
|
|
702
|
+
export function inputCacheWriteToJSON(
|
|
703
|
+
inputCacheWrite: InputCacheWrite,
|
|
720
704
|
): string {
|
|
721
|
-
return JSON.stringify(
|
|
722
|
-
PreviewZDRInputCacheWrite$outboundSchema.parse(previewZDRInputCacheWrite),
|
|
723
|
-
);
|
|
705
|
+
return JSON.stringify(InputCacheWrite$outboundSchema.parse(inputCacheWrite));
|
|
724
706
|
}
|
|
725
707
|
|
|
726
|
-
export function
|
|
708
|
+
export function inputCacheWriteFromJSON(
|
|
727
709
|
jsonString: string,
|
|
728
|
-
): SafeParseResult<
|
|
710
|
+
): SafeParseResult<InputCacheWrite, SDKValidationError> {
|
|
729
711
|
return safeParse(
|
|
730
712
|
jsonString,
|
|
731
|
-
(x) =>
|
|
732
|
-
`Failed to parse '
|
|
713
|
+
(x) => InputCacheWrite$inboundSchema.parse(JSON.parse(x)),
|
|
714
|
+
`Failed to parse 'InputCacheWrite' from JSON`,
|
|
733
715
|
);
|
|
734
716
|
}
|
|
735
717
|
|
|
736
718
|
/** @internal */
|
|
737
|
-
export const
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
"input_cache_read": "inputCacheRead",
|
|
761
|
-
"input_cache_write": "inputCacheWrite",
|
|
719
|
+
export const Pricing$inboundSchema: z.ZodType<Pricing, z.ZodTypeDef, unknown> =
|
|
720
|
+
z.object({
|
|
721
|
+
prompt: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
722
|
+
completion: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
723
|
+
request: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
724
|
+
image: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
725
|
+
image_output: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
726
|
+
audio: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
727
|
+
input_audio_cache: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
728
|
+
web_search: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
729
|
+
internal_reasoning: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
730
|
+
input_cache_read: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
731
|
+
input_cache_write: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
732
|
+
discount: z.number().optional(),
|
|
733
|
+
}).transform((v) => {
|
|
734
|
+
return remap$(v, {
|
|
735
|
+
"image_output": "imageOutput",
|
|
736
|
+
"input_audio_cache": "inputAudioCache",
|
|
737
|
+
"web_search": "webSearch",
|
|
738
|
+
"internal_reasoning": "internalReasoning",
|
|
739
|
+
"input_cache_read": "inputCacheRead",
|
|
740
|
+
"input_cache_write": "inputCacheWrite",
|
|
741
|
+
});
|
|
762
742
|
});
|
|
763
|
-
});
|
|
764
743
|
|
|
765
744
|
/** @internal */
|
|
766
|
-
export type
|
|
745
|
+
export type Pricing$Outbound = {
|
|
767
746
|
prompt?: number | string | any | undefined;
|
|
768
747
|
completion?: number | string | any | undefined;
|
|
769
748
|
request?: number | string | any | undefined;
|
|
@@ -779,10 +758,10 @@ export type PreviewZDRPricing$Outbound = {
|
|
|
779
758
|
};
|
|
780
759
|
|
|
781
760
|
/** @internal */
|
|
782
|
-
export const
|
|
783
|
-
|
|
761
|
+
export const Pricing$outboundSchema: z.ZodType<
|
|
762
|
+
Pricing$Outbound,
|
|
784
763
|
z.ZodTypeDef,
|
|
785
|
-
|
|
764
|
+
Pricing
|
|
786
765
|
> = z.object({
|
|
787
766
|
prompt: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
788
767
|
completion: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
@@ -811,52 +790,46 @@ export const PreviewZDRPricing$outboundSchema: z.ZodType<
|
|
|
811
790
|
* @internal
|
|
812
791
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
813
792
|
*/
|
|
814
|
-
export namespace
|
|
815
|
-
/** @deprecated use `
|
|
816
|
-
export const inboundSchema =
|
|
817
|
-
/** @deprecated use `
|
|
818
|
-
export const outboundSchema =
|
|
819
|
-
/** @deprecated use `
|
|
820
|
-
export type Outbound =
|
|
793
|
+
export namespace Pricing$ {
|
|
794
|
+
/** @deprecated use `Pricing$inboundSchema` instead. */
|
|
795
|
+
export const inboundSchema = Pricing$inboundSchema;
|
|
796
|
+
/** @deprecated use `Pricing$outboundSchema` instead. */
|
|
797
|
+
export const outboundSchema = Pricing$outboundSchema;
|
|
798
|
+
/** @deprecated use `Pricing$Outbound` instead. */
|
|
799
|
+
export type Outbound = Pricing$Outbound;
|
|
821
800
|
}
|
|
822
801
|
|
|
823
|
-
export function
|
|
824
|
-
|
|
825
|
-
): string {
|
|
826
|
-
return JSON.stringify(
|
|
827
|
-
PreviewZDRPricing$outboundSchema.parse(previewZDRPricing),
|
|
828
|
-
);
|
|
802
|
+
export function pricingToJSON(pricing: Pricing): string {
|
|
803
|
+
return JSON.stringify(Pricing$outboundSchema.parse(pricing));
|
|
829
804
|
}
|
|
830
805
|
|
|
831
|
-
export function
|
|
806
|
+
export function pricingFromJSON(
|
|
832
807
|
jsonString: string,
|
|
833
|
-
): SafeParseResult<
|
|
808
|
+
): SafeParseResult<Pricing, SDKValidationError> {
|
|
834
809
|
return safeParse(
|
|
835
810
|
jsonString,
|
|
836
|
-
(x) =>
|
|
837
|
-
`Failed to parse '
|
|
811
|
+
(x) => Pricing$inboundSchema.parse(JSON.parse(x)),
|
|
812
|
+
`Failed to parse 'Pricing' from JSON`,
|
|
838
813
|
);
|
|
839
814
|
}
|
|
840
815
|
|
|
841
816
|
/** @internal */
|
|
842
|
-
export const
|
|
843
|
-
|
|
844
|
-
> = z.nativeEnum(PreviewZDRProviderName);
|
|
817
|
+
export const ProviderName$inboundSchema: z.ZodNativeEnum<typeof ProviderName> =
|
|
818
|
+
z.nativeEnum(ProviderName);
|
|
845
819
|
|
|
846
820
|
/** @internal */
|
|
847
|
-
export const
|
|
848
|
-
|
|
849
|
-
> = PreviewZDRProviderName$inboundSchema;
|
|
821
|
+
export const ProviderName$outboundSchema: z.ZodNativeEnum<typeof ProviderName> =
|
|
822
|
+
ProviderName$inboundSchema;
|
|
850
823
|
|
|
851
824
|
/**
|
|
852
825
|
* @internal
|
|
853
826
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
854
827
|
*/
|
|
855
|
-
export namespace
|
|
856
|
-
/** @deprecated use `
|
|
857
|
-
export const inboundSchema =
|
|
858
|
-
/** @deprecated use `
|
|
859
|
-
export const outboundSchema =
|
|
828
|
+
export namespace ProviderName$ {
|
|
829
|
+
/** @deprecated use `ProviderName$inboundSchema` instead. */
|
|
830
|
+
export const inboundSchema = ProviderName$inboundSchema;
|
|
831
|
+
/** @deprecated use `ProviderName$outboundSchema` instead. */
|
|
832
|
+
export const outboundSchema = ProviderName$outboundSchema;
|
|
860
833
|
}
|
|
861
834
|
|
|
862
835
|
/** @internal */
|
|
@@ -902,24 +875,22 @@ export namespace PreviewZDRSupportedParameter$ {
|
|
|
902
875
|
}
|
|
903
876
|
|
|
904
877
|
/** @internal */
|
|
905
|
-
export const
|
|
906
|
-
|
|
907
|
-
> = z.nativeEnum(PreviewZDRStatus);
|
|
878
|
+
export const Status$inboundSchema: z.ZodNativeEnum<typeof Status> = z
|
|
879
|
+
.nativeEnum(Status);
|
|
908
880
|
|
|
909
881
|
/** @internal */
|
|
910
|
-
export const
|
|
911
|
-
|
|
912
|
-
> = PreviewZDRStatus$inboundSchema;
|
|
882
|
+
export const Status$outboundSchema: z.ZodNativeEnum<typeof Status> =
|
|
883
|
+
Status$inboundSchema;
|
|
913
884
|
|
|
914
885
|
/**
|
|
915
886
|
* @internal
|
|
916
887
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
917
888
|
*/
|
|
918
|
-
export namespace
|
|
919
|
-
/** @deprecated use `
|
|
920
|
-
export const inboundSchema =
|
|
921
|
-
/** @deprecated use `
|
|
922
|
-
export const outboundSchema =
|
|
889
|
+
export namespace Status$ {
|
|
890
|
+
/** @deprecated use `Status$inboundSchema` instead. */
|
|
891
|
+
export const inboundSchema = Status$inboundSchema;
|
|
892
|
+
/** @deprecated use `Status$outboundSchema` instead. */
|
|
893
|
+
export const outboundSchema = Status$outboundSchema;
|
|
923
894
|
}
|
|
924
895
|
|
|
925
896
|
/** @internal */
|
|
@@ -931,14 +902,14 @@ export const PreviewZDRData$inboundSchema: z.ZodType<
|
|
|
931
902
|
name: z.string(),
|
|
932
903
|
model_name: z.string(),
|
|
933
904
|
context_length: z.number(),
|
|
934
|
-
pricing: z.lazy(() =>
|
|
935
|
-
provider_name:
|
|
905
|
+
pricing: z.lazy(() => Pricing$inboundSchema),
|
|
906
|
+
provider_name: ProviderName$inboundSchema,
|
|
936
907
|
tag: z.string(),
|
|
937
908
|
quantization: z.nullable(PreviewZDRQuantization$inboundSchema),
|
|
938
909
|
max_completion_tokens: z.nullable(z.number()),
|
|
939
910
|
max_prompt_tokens: z.nullable(z.number()),
|
|
940
911
|
supported_parameters: z.array(PreviewZDRSupportedParameter$inboundSchema),
|
|
941
|
-
status:
|
|
912
|
+
status: Status$inboundSchema.optional(),
|
|
942
913
|
uptime_last_30m: z.nullable(z.number()),
|
|
943
914
|
supports_implicit_caching: z.boolean(),
|
|
944
915
|
}).transform((v) => {
|
|
@@ -959,7 +930,7 @@ export type PreviewZDRData$Outbound = {
|
|
|
959
930
|
name: string;
|
|
960
931
|
model_name: string;
|
|
961
932
|
context_length: number;
|
|
962
|
-
pricing:
|
|
933
|
+
pricing: Pricing$Outbound;
|
|
963
934
|
provider_name: string;
|
|
964
935
|
tag: string;
|
|
965
936
|
quantization: string | null;
|
|
@@ -980,14 +951,14 @@ export const PreviewZDRData$outboundSchema: z.ZodType<
|
|
|
980
951
|
name: z.string(),
|
|
981
952
|
modelName: z.string(),
|
|
982
953
|
contextLength: z.number(),
|
|
983
|
-
pricing: z.lazy(() =>
|
|
984
|
-
providerName:
|
|
954
|
+
pricing: z.lazy(() => Pricing$outboundSchema),
|
|
955
|
+
providerName: ProviderName$outboundSchema,
|
|
985
956
|
tag: z.string(),
|
|
986
957
|
quantization: z.nullable(PreviewZDRQuantization$outboundSchema),
|
|
987
958
|
maxCompletionTokens: z.nullable(z.number()),
|
|
988
959
|
maxPromptTokens: z.nullable(z.number()),
|
|
989
960
|
supportedParameters: z.array(PreviewZDRSupportedParameter$outboundSchema),
|
|
990
|
-
status:
|
|
961
|
+
status: Status$outboundSchema.optional(),
|
|
991
962
|
uptimeLast30m: z.nullable(z.number()),
|
|
992
963
|
supportsImplicitCaching: z.boolean(),
|
|
993
964
|
}).transform((v) => {
|