@orq-ai/node 3.11.7 → 3.11.8

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.
Files changed (155) hide show
  1. package/bin/mcp-server.js +104 -104
  2. package/bin/mcp-server.js.map +26 -26
  3. package/examples/package-lock.json +1 -1
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +3 -3
  6. package/lib/config.js +3 -3
  7. package/mcp-server/mcp-server.js +1 -1
  8. package/mcp-server/server.js +1 -1
  9. package/models/operations/createcontact.js +2 -2
  10. package/models/operations/createdataset.js +2 -2
  11. package/models/operations/createdatasetitem.js +2 -2
  12. package/models/operations/createdatasource.js +2 -2
  13. package/models/operations/createeval.js +16 -16
  14. package/models/operations/fileget.js +2 -2
  15. package/models/operations/filelist.js +2 -2
  16. package/models/operations/fileupload.js +2 -2
  17. package/models/operations/getevals.js +28 -28
  18. package/models/operations/listcontacts.js +2 -2
  19. package/models/operations/listdatasetdatapoints.js +2 -2
  20. package/models/operations/listdatasets.js +2 -2
  21. package/models/operations/listdatasources.js +2 -2
  22. package/models/operations/retrievecontact.js +2 -2
  23. package/models/operations/retrievedatapoint.js +2 -2
  24. package/models/operations/retrievedataset.js +2 -2
  25. package/models/operations/retrievedatasource.js +2 -2
  26. package/models/operations/updatecontact.js +2 -2
  27. package/models/operations/updatedatapoint.js +2 -2
  28. package/models/operations/updatedataset.js +2 -2
  29. package/models/operations/updatedatasource.js +2 -2
  30. package/models/operations/updateeval.js +16 -16
  31. package/package.json +1 -1
  32. package/packages/orq-rc/README.md +128 -87
  33. package/packages/orq-rc/docs/sdks/batches/README.md +307 -0
  34. package/packages/orq-rc/docs/sdks/proxy/README.md +1212 -0
  35. package/packages/orq-rc/examples/package-lock.json +1 -1
  36. package/packages/orq-rc/jsr.json +1 -1
  37. package/packages/orq-rc/package-lock.json +2 -2
  38. package/packages/orq-rc/package.json +1 -1
  39. package/packages/orq-rc/src/funcs/batchesCancel.ts +166 -0
  40. package/packages/orq-rc/src/funcs/batchesCreate.ts +160 -0
  41. package/packages/orq-rc/src/funcs/batchesList.ts +165 -0
  42. package/packages/orq-rc/src/funcs/batchesRetrieve.ts +166 -0
  43. package/packages/orq-rc/src/funcs/proxyAudioSpeech.ts +159 -0
  44. package/packages/orq-rc/src/funcs/proxyAudioTranscriptions.ts +233 -0
  45. package/packages/orq-rc/src/funcs/proxyAudioTranslations.ts +223 -0
  46. package/packages/orq-rc/src/funcs/proxyChatCompletions.ts +172 -0
  47. package/packages/orq-rc/src/funcs/proxyCompletions.ts +168 -0
  48. package/packages/orq-rc/src/funcs/proxyEmbeddings.ts +161 -0
  49. package/packages/orq-rc/src/funcs/proxyImagesEdit.ts +173 -0
  50. package/packages/orq-rc/src/funcs/proxyImagesGenerate.ts +163 -0
  51. package/packages/orq-rc/src/funcs/proxyImagesVariation.ts +179 -0
  52. package/packages/orq-rc/src/funcs/proxyModerations.ts +164 -0
  53. package/packages/orq-rc/src/funcs/proxyRerank.ts +158 -0
  54. package/packages/orq-rc/src/funcs/proxyResponsesCreate.ts +171 -0
  55. package/packages/orq-rc/src/lib/config.ts +3 -3
  56. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  57. package/packages/orq-rc/src/mcp-server/server.ts +33 -1
  58. package/packages/orq-rc/src/mcp-server/tools/batchesCancel.ts +37 -0
  59. package/packages/orq-rc/src/mcp-server/tools/batchesCreate.ts +37 -0
  60. package/packages/orq-rc/src/mcp-server/tools/batchesList.ts +37 -0
  61. package/packages/orq-rc/src/mcp-server/tools/batchesRetrieve.ts +37 -0
  62. package/packages/orq-rc/src/mcp-server/tools/proxyAudioSpeech.ts +33 -0
  63. package/packages/orq-rc/src/mcp-server/tools/proxyAudioTranscriptions.ts +35 -0
  64. package/packages/orq-rc/src/mcp-server/tools/proxyAudioTranslations.ts +35 -0
  65. package/packages/orq-rc/src/mcp-server/tools/proxyChatCompletions.ts +37 -0
  66. package/packages/orq-rc/src/mcp-server/tools/proxyCompletions.ts +37 -0
  67. package/packages/orq-rc/src/mcp-server/tools/proxyEmbeddings.ts +37 -0
  68. package/packages/orq-rc/src/mcp-server/tools/proxyImagesEdit.ts +35 -0
  69. package/packages/orq-rc/src/mcp-server/tools/proxyImagesGenerate.ts +35 -0
  70. package/packages/orq-rc/src/mcp-server/tools/proxyImagesVariation.ts +35 -0
  71. package/packages/orq-rc/src/mcp-server/tools/proxyModerations.ts +35 -0
  72. package/packages/orq-rc/src/mcp-server/tools/proxyRerank.ts +36 -0
  73. package/packages/orq-rc/src/mcp-server/tools/proxyResponsesCreate.ts +37 -0
  74. package/packages/orq-rc/src/models/components/deployments.ts +861 -0
  75. package/packages/orq-rc/src/models/components/index.ts +1 -0
  76. package/packages/orq-rc/src/models/components/publiccontact.ts +114 -0
  77. package/packages/orq-rc/src/models/errors/index.ts +3 -0
  78. package/packages/orq-rc/src/models/errors/postv2proxyaudiotranscriptions.ts +163 -0
  79. package/packages/orq-rc/src/models/errors/postv2proxyaudiotranslations.ts +162 -0
  80. package/packages/orq-rc/src/models/errors/postv2proxymoderations.ts +151 -0
  81. package/packages/orq-rc/src/models/operations/cancelbatch.ts +474 -0
  82. package/packages/orq-rc/src/models/operations/createbatch.ts +531 -0
  83. package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
  84. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +11697 -0
  85. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  86. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  87. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2205 -1224
  88. package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
  89. package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
  90. package/packages/orq-rc/src/models/operations/createresponse.ts +6908 -0
  91. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +2282 -1214
  92. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +938 -51
  93. package/packages/orq-rc/src/models/operations/deploymentstream.ts +1471 -305
  94. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  95. package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
  96. package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
  97. package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
  98. package/packages/orq-rc/src/models/operations/getevals.ts +107 -92
  99. package/packages/orq-rc/src/models/operations/index.ts +16 -0
  100. package/packages/orq-rc/src/models/operations/listbatches.ts +570 -0
  101. package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
  102. package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
  103. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +498 -2
  104. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  105. package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
  106. package/packages/orq-rc/src/models/operations/postv2proxyaudiospeech.ts +393 -0
  107. package/packages/orq-rc/src/models/operations/postv2proxyaudiotranscriptions.ts +731 -0
  108. package/packages/orq-rc/src/models/operations/postv2proxyaudiotranslations.ts +741 -0
  109. package/packages/orq-rc/src/models/operations/postv2proxycompletions.ts +5831 -0
  110. package/packages/orq-rc/src/models/operations/postv2proxyembeddings.ts +543 -0
  111. package/packages/orq-rc/src/models/operations/postv2proxyimagesedits.ts +596 -0
  112. package/packages/orq-rc/src/models/operations/postv2proxyimagesgenerations.ts +1107 -0
  113. package/packages/orq-rc/src/models/operations/postv2proxyimagesvariations.ts +592 -0
  114. package/packages/orq-rc/src/models/operations/postv2proxymoderations.ts +802 -0
  115. package/packages/orq-rc/src/models/operations/postv2proxyrerank.ts +526 -0
  116. package/packages/orq-rc/src/models/operations/retrievebatch.ts +474 -0
  117. package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
  118. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +478 -2
  119. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  120. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
  121. package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -2
  122. package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
  123. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +974 -2
  124. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  125. package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
  126. package/packages/orq-rc/src/models/operations/updateeval.ts +16 -16
  127. package/packages/orq-rc/src/sdk/batches.ts +81 -0
  128. package/packages/orq-rc/src/sdk/proxy.ts +211 -0
  129. package/packages/orq-rc/src/sdk/sdk.ts +12 -0
  130. package/packages/orq-rc/temp/example.ts +5 -0
  131. package/src/lib/config.ts +3 -3
  132. package/src/mcp-server/mcp-server.ts +1 -1
  133. package/src/mcp-server/server.ts +1 -1
  134. package/src/models/operations/createcontact.ts +2 -2
  135. package/src/models/operations/createdataset.ts +2 -2
  136. package/src/models/operations/createdatasetitem.ts +2 -2
  137. package/src/models/operations/createdatasource.ts +2 -2
  138. package/src/models/operations/createeval.ts +16 -16
  139. package/src/models/operations/fileget.ts +2 -2
  140. package/src/models/operations/filelist.ts +2 -2
  141. package/src/models/operations/fileupload.ts +2 -2
  142. package/src/models/operations/getevals.ts +28 -28
  143. package/src/models/operations/listcontacts.ts +2 -2
  144. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  145. package/src/models/operations/listdatasets.ts +2 -2
  146. package/src/models/operations/listdatasources.ts +2 -2
  147. package/src/models/operations/retrievecontact.ts +2 -2
  148. package/src/models/operations/retrievedatapoint.ts +2 -2
  149. package/src/models/operations/retrievedataset.ts +2 -2
  150. package/src/models/operations/retrievedatasource.ts +2 -2
  151. package/src/models/operations/updatecontact.ts +2 -2
  152. package/src/models/operations/updatedatapoint.ts +2 -2
  153. package/src/models/operations/updatedataset.ts +2 -2
  154. package/src/models/operations/updatedatasource.ts +2 -2
  155. package/src/models/operations/updateeval.ts +16 -16
@@ -0,0 +1,731 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { blobLikeSchema } from "../../types/blobs.js";
9
+ import { ClosedEnum } from "../../types/enums.js";
10
+ import { Result as SafeParseResult } from "../../types/fp.js";
11
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
+
13
+ /**
14
+ * The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
15
+ */
16
+ export const PostV2ProxyAudioTranscriptionsResponseFormat = {
17
+ Json: "json",
18
+ Text: "text",
19
+ Srt: "srt",
20
+ VerboseJson: "verbose_json",
21
+ Vtt: "vtt",
22
+ } as const;
23
+ /**
24
+ * The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
25
+ */
26
+ export type PostV2ProxyAudioTranscriptionsResponseFormat = ClosedEnum<
27
+ typeof PostV2ProxyAudioTranscriptionsResponseFormat
28
+ >;
29
+
30
+ /**
31
+ * The granularity of the timestamps in the transcription. Word provides word-level timestamps and character provides character-level timestamps per word.
32
+ */
33
+ export const TimestampsGranularity = {
34
+ None: "none",
35
+ Word: "word",
36
+ Character: "character",
37
+ } as const;
38
+ /**
39
+ * The granularity of the timestamps in the transcription. Word provides word-level timestamps and character provides character-level timestamps per word.
40
+ */
41
+ export type TimestampsGranularity = ClosedEnum<typeof TimestampsGranularity>;
42
+
43
+ export const TimestampGranularities = {
44
+ Word: "word",
45
+ Segment: "segment",
46
+ } as const;
47
+ export type TimestampGranularities = ClosedEnum<typeof TimestampGranularities>;
48
+
49
+ export type PostV2ProxyAudioTranscriptionsFile = {
50
+ fileName: string;
51
+ content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
52
+ };
53
+
54
+ /**
55
+ * Transcribes audio into the input language.
56
+ */
57
+ export type PostV2ProxyAudioTranscriptionsRequestBody = {
58
+ /**
59
+ * ID of the model to use
60
+ */
61
+ model?: string | undefined;
62
+ /**
63
+ * An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
64
+ */
65
+ prompt?: string | undefined;
66
+ /**
67
+ * When enable_logging is set to false, zero retention mode is used. This disables history features like request stitching and is only available to enterprise customers.
68
+ */
69
+ enableLogging?: boolean | undefined;
70
+ /**
71
+ * Whether to annotate which speaker is currently talking in the uploaded file.
72
+ */
73
+ diarize?: boolean | undefined;
74
+ /**
75
+ * The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
76
+ */
77
+ responseFormat?: PostV2ProxyAudioTranscriptionsResponseFormat | undefined;
78
+ /**
79
+ * Whether to tag audio events like (laughter), (footsteps), etc. in the transcription.
80
+ */
81
+ tagAudioEvents?: boolean | undefined;
82
+ /**
83
+ * The maximum amount of speakers talking in the uploaded file. Helps with predicting who speaks when, the maximum is 32.
84
+ */
85
+ numSpeakers?: number | undefined;
86
+ /**
87
+ * The granularity of the timestamps in the transcription. Word provides word-level timestamps and character provides character-level timestamps per word.
88
+ */
89
+ timestampsGranularity?: TimestampsGranularity | undefined;
90
+ /**
91
+ * The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
92
+ */
93
+ temperature?: number | undefined;
94
+ /**
95
+ * The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.
96
+ */
97
+ language?: string | undefined;
98
+ /**
99
+ * The timestamp granularities to populate for this transcription. response_format must be set to verbose_json to use timestamp granularities. Either or both of these options are supported: "word" or "segment". Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
100
+ */
101
+ timestampGranularities?: Array<TimestampGranularities> | undefined;
102
+ /**
103
+ * The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
104
+ */
105
+ file: PostV2ProxyAudioTranscriptionsFile | Blob;
106
+ };
107
+
108
+ export type Words = {
109
+ word?: string | undefined;
110
+ start?: number | undefined;
111
+ end?: number | undefined;
112
+ };
113
+
114
+ export type Segments = {
115
+ id: number;
116
+ seek: number;
117
+ start: number;
118
+ end: number;
119
+ text: string;
120
+ tokens: Array<number>;
121
+ temperature: number;
122
+ avgLogprob: number;
123
+ compressionRatio: number;
124
+ noSpeechProb: number;
125
+ };
126
+
127
+ export type ResponseBody2 = {
128
+ task?: string | undefined;
129
+ language?: string | undefined;
130
+ duration?: number | undefined;
131
+ text: string;
132
+ words?: Array<Words> | undefined;
133
+ segments?: Array<Segments> | undefined;
134
+ };
135
+
136
+ export type ResponseBody1 = {
137
+ text: string;
138
+ };
139
+
140
+ /**
141
+ * Returns the transcription or verbose transcription
142
+ */
143
+ export type PostV2ProxyAudioTranscriptionsResponseBody =
144
+ | ResponseBody1
145
+ | ResponseBody2
146
+ | string;
147
+
148
+ /** @internal */
149
+ export const PostV2ProxyAudioTranscriptionsResponseFormat$inboundSchema:
150
+ z.ZodNativeEnum<typeof PostV2ProxyAudioTranscriptionsResponseFormat> = z
151
+ .nativeEnum(PostV2ProxyAudioTranscriptionsResponseFormat);
152
+
153
+ /** @internal */
154
+ export const PostV2ProxyAudioTranscriptionsResponseFormat$outboundSchema:
155
+ z.ZodNativeEnum<typeof PostV2ProxyAudioTranscriptionsResponseFormat> =
156
+ PostV2ProxyAudioTranscriptionsResponseFormat$inboundSchema;
157
+
158
+ /**
159
+ * @internal
160
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
161
+ */
162
+ export namespace PostV2ProxyAudioTranscriptionsResponseFormat$ {
163
+ /** @deprecated use `PostV2ProxyAudioTranscriptionsResponseFormat$inboundSchema` instead. */
164
+ export const inboundSchema =
165
+ PostV2ProxyAudioTranscriptionsResponseFormat$inboundSchema;
166
+ /** @deprecated use `PostV2ProxyAudioTranscriptionsResponseFormat$outboundSchema` instead. */
167
+ export const outboundSchema =
168
+ PostV2ProxyAudioTranscriptionsResponseFormat$outboundSchema;
169
+ }
170
+
171
+ /** @internal */
172
+ export const TimestampsGranularity$inboundSchema: z.ZodNativeEnum<
173
+ typeof TimestampsGranularity
174
+ > = z.nativeEnum(TimestampsGranularity);
175
+
176
+ /** @internal */
177
+ export const TimestampsGranularity$outboundSchema: z.ZodNativeEnum<
178
+ typeof TimestampsGranularity
179
+ > = TimestampsGranularity$inboundSchema;
180
+
181
+ /**
182
+ * @internal
183
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
184
+ */
185
+ export namespace TimestampsGranularity$ {
186
+ /** @deprecated use `TimestampsGranularity$inboundSchema` instead. */
187
+ export const inboundSchema = TimestampsGranularity$inboundSchema;
188
+ /** @deprecated use `TimestampsGranularity$outboundSchema` instead. */
189
+ export const outboundSchema = TimestampsGranularity$outboundSchema;
190
+ }
191
+
192
+ /** @internal */
193
+ export const TimestampGranularities$inboundSchema: z.ZodNativeEnum<
194
+ typeof TimestampGranularities
195
+ > = z.nativeEnum(TimestampGranularities);
196
+
197
+ /** @internal */
198
+ export const TimestampGranularities$outboundSchema: z.ZodNativeEnum<
199
+ typeof TimestampGranularities
200
+ > = TimestampGranularities$inboundSchema;
201
+
202
+ /**
203
+ * @internal
204
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
205
+ */
206
+ export namespace TimestampGranularities$ {
207
+ /** @deprecated use `TimestampGranularities$inboundSchema` instead. */
208
+ export const inboundSchema = TimestampGranularities$inboundSchema;
209
+ /** @deprecated use `TimestampGranularities$outboundSchema` instead. */
210
+ export const outboundSchema = TimestampGranularities$outboundSchema;
211
+ }
212
+
213
+ /** @internal */
214
+ export const PostV2ProxyAudioTranscriptionsFile$inboundSchema: z.ZodType<
215
+ PostV2ProxyAudioTranscriptionsFile,
216
+ z.ZodTypeDef,
217
+ unknown
218
+ > = z.object({
219
+ fileName: z.string(),
220
+ content: z.union([
221
+ z.instanceof(ReadableStream<Uint8Array>),
222
+ z.instanceof(Blob),
223
+ z.instanceof(ArrayBuffer),
224
+ z.instanceof(Uint8Array),
225
+ ]),
226
+ });
227
+
228
+ /** @internal */
229
+ export type PostV2ProxyAudioTranscriptionsFile$Outbound = {
230
+ fileName: string;
231
+ content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
232
+ };
233
+
234
+ /** @internal */
235
+ export const PostV2ProxyAudioTranscriptionsFile$outboundSchema: z.ZodType<
236
+ PostV2ProxyAudioTranscriptionsFile$Outbound,
237
+ z.ZodTypeDef,
238
+ PostV2ProxyAudioTranscriptionsFile
239
+ > = z.object({
240
+ fileName: z.string(),
241
+ content: z.union([
242
+ z.instanceof(ReadableStream<Uint8Array>),
243
+ z.instanceof(Blob),
244
+ z.instanceof(ArrayBuffer),
245
+ z.instanceof(Uint8Array),
246
+ ]),
247
+ });
248
+
249
+ /**
250
+ * @internal
251
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
252
+ */
253
+ export namespace PostV2ProxyAudioTranscriptionsFile$ {
254
+ /** @deprecated use `PostV2ProxyAudioTranscriptionsFile$inboundSchema` instead. */
255
+ export const inboundSchema = PostV2ProxyAudioTranscriptionsFile$inboundSchema;
256
+ /** @deprecated use `PostV2ProxyAudioTranscriptionsFile$outboundSchema` instead. */
257
+ export const outboundSchema =
258
+ PostV2ProxyAudioTranscriptionsFile$outboundSchema;
259
+ /** @deprecated use `PostV2ProxyAudioTranscriptionsFile$Outbound` instead. */
260
+ export type Outbound = PostV2ProxyAudioTranscriptionsFile$Outbound;
261
+ }
262
+
263
+ export function postV2ProxyAudioTranscriptionsFileToJSON(
264
+ postV2ProxyAudioTranscriptionsFile: PostV2ProxyAudioTranscriptionsFile,
265
+ ): string {
266
+ return JSON.stringify(
267
+ PostV2ProxyAudioTranscriptionsFile$outboundSchema.parse(
268
+ postV2ProxyAudioTranscriptionsFile,
269
+ ),
270
+ );
271
+ }
272
+
273
+ export function postV2ProxyAudioTranscriptionsFileFromJSON(
274
+ jsonString: string,
275
+ ): SafeParseResult<PostV2ProxyAudioTranscriptionsFile, SDKValidationError> {
276
+ return safeParse(
277
+ jsonString,
278
+ (x) =>
279
+ PostV2ProxyAudioTranscriptionsFile$inboundSchema.parse(JSON.parse(x)),
280
+ `Failed to parse 'PostV2ProxyAudioTranscriptionsFile' from JSON`,
281
+ );
282
+ }
283
+
284
+ /** @internal */
285
+ export const PostV2ProxyAudioTranscriptionsRequestBody$inboundSchema: z.ZodType<
286
+ PostV2ProxyAudioTranscriptionsRequestBody,
287
+ z.ZodTypeDef,
288
+ unknown
289
+ > = z.object({
290
+ model: z.string().default("openai/whisper-1"),
291
+ prompt: z.string().optional(),
292
+ enable_logging: z.boolean().default(true),
293
+ diarize: z.boolean().default(false),
294
+ response_format: PostV2ProxyAudioTranscriptionsResponseFormat$inboundSchema
295
+ .optional(),
296
+ tag_audio_events: z.boolean().default(true),
297
+ num_speakers: z.number().optional(),
298
+ timestamps_granularity: TimestampsGranularity$inboundSchema.default("word"),
299
+ temperature: z.number().optional(),
300
+ language: z.string().optional(),
301
+ timestamp_granularities: z.array(TimestampGranularities$inboundSchema)
302
+ .optional(),
303
+ file: z.lazy(() => PostV2ProxyAudioTranscriptionsFile$inboundSchema),
304
+ }).transform((v) => {
305
+ return remap$(v, {
306
+ "enable_logging": "enableLogging",
307
+ "response_format": "responseFormat",
308
+ "tag_audio_events": "tagAudioEvents",
309
+ "num_speakers": "numSpeakers",
310
+ "timestamps_granularity": "timestampsGranularity",
311
+ "timestamp_granularities": "timestampGranularities",
312
+ });
313
+ });
314
+
315
+ /** @internal */
316
+ export type PostV2ProxyAudioTranscriptionsRequestBody$Outbound = {
317
+ model: string;
318
+ prompt?: string | undefined;
319
+ enable_logging: boolean;
320
+ diarize: boolean;
321
+ response_format?: string | undefined;
322
+ tag_audio_events: boolean;
323
+ num_speakers?: number | undefined;
324
+ timestamps_granularity: string;
325
+ temperature?: number | undefined;
326
+ language?: string | undefined;
327
+ timestamp_granularities?: Array<string> | undefined;
328
+ file: PostV2ProxyAudioTranscriptionsFile$Outbound | Blob;
329
+ };
330
+
331
+ /** @internal */
332
+ export const PostV2ProxyAudioTranscriptionsRequestBody$outboundSchema:
333
+ z.ZodType<
334
+ PostV2ProxyAudioTranscriptionsRequestBody$Outbound,
335
+ z.ZodTypeDef,
336
+ PostV2ProxyAudioTranscriptionsRequestBody
337
+ > = z.object({
338
+ model: z.string().default("openai/whisper-1"),
339
+ prompt: z.string().optional(),
340
+ enableLogging: z.boolean().default(true),
341
+ diarize: z.boolean().default(false),
342
+ responseFormat: PostV2ProxyAudioTranscriptionsResponseFormat$outboundSchema
343
+ .optional(),
344
+ tagAudioEvents: z.boolean().default(true),
345
+ numSpeakers: z.number().optional(),
346
+ timestampsGranularity: TimestampsGranularity$outboundSchema.default("word"),
347
+ temperature: z.number().optional(),
348
+ language: z.string().optional(),
349
+ timestampGranularities: z.array(TimestampGranularities$outboundSchema)
350
+ .optional(),
351
+ file: z.lazy(() => PostV2ProxyAudioTranscriptionsFile$outboundSchema).or(
352
+ blobLikeSchema,
353
+ ),
354
+ }).transform((v) => {
355
+ return remap$(v, {
356
+ enableLogging: "enable_logging",
357
+ responseFormat: "response_format",
358
+ tagAudioEvents: "tag_audio_events",
359
+ numSpeakers: "num_speakers",
360
+ timestampsGranularity: "timestamps_granularity",
361
+ timestampGranularities: "timestamp_granularities",
362
+ });
363
+ });
364
+
365
+ /**
366
+ * @internal
367
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
368
+ */
369
+ export namespace PostV2ProxyAudioTranscriptionsRequestBody$ {
370
+ /** @deprecated use `PostV2ProxyAudioTranscriptionsRequestBody$inboundSchema` instead. */
371
+ export const inboundSchema =
372
+ PostV2ProxyAudioTranscriptionsRequestBody$inboundSchema;
373
+ /** @deprecated use `PostV2ProxyAudioTranscriptionsRequestBody$outboundSchema` instead. */
374
+ export const outboundSchema =
375
+ PostV2ProxyAudioTranscriptionsRequestBody$outboundSchema;
376
+ /** @deprecated use `PostV2ProxyAudioTranscriptionsRequestBody$Outbound` instead. */
377
+ export type Outbound = PostV2ProxyAudioTranscriptionsRequestBody$Outbound;
378
+ }
379
+
380
+ export function postV2ProxyAudioTranscriptionsRequestBodyToJSON(
381
+ postV2ProxyAudioTranscriptionsRequestBody:
382
+ PostV2ProxyAudioTranscriptionsRequestBody,
383
+ ): string {
384
+ return JSON.stringify(
385
+ PostV2ProxyAudioTranscriptionsRequestBody$outboundSchema.parse(
386
+ postV2ProxyAudioTranscriptionsRequestBody,
387
+ ),
388
+ );
389
+ }
390
+
391
+ export function postV2ProxyAudioTranscriptionsRequestBodyFromJSON(
392
+ jsonString: string,
393
+ ): SafeParseResult<
394
+ PostV2ProxyAudioTranscriptionsRequestBody,
395
+ SDKValidationError
396
+ > {
397
+ return safeParse(
398
+ jsonString,
399
+ (x) =>
400
+ PostV2ProxyAudioTranscriptionsRequestBody$inboundSchema.parse(
401
+ JSON.parse(x),
402
+ ),
403
+ `Failed to parse 'PostV2ProxyAudioTranscriptionsRequestBody' from JSON`,
404
+ );
405
+ }
406
+
407
+ /** @internal */
408
+ export const Words$inboundSchema: z.ZodType<Words, z.ZodTypeDef, unknown> = z
409
+ .object({
410
+ word: z.string().optional(),
411
+ start: z.number().optional(),
412
+ end: z.number().optional(),
413
+ });
414
+
415
+ /** @internal */
416
+ export type Words$Outbound = {
417
+ word?: string | undefined;
418
+ start?: number | undefined;
419
+ end?: number | undefined;
420
+ };
421
+
422
+ /** @internal */
423
+ export const Words$outboundSchema: z.ZodType<
424
+ Words$Outbound,
425
+ z.ZodTypeDef,
426
+ Words
427
+ > = z.object({
428
+ word: z.string().optional(),
429
+ start: z.number().optional(),
430
+ end: z.number().optional(),
431
+ });
432
+
433
+ /**
434
+ * @internal
435
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
436
+ */
437
+ export namespace Words$ {
438
+ /** @deprecated use `Words$inboundSchema` instead. */
439
+ export const inboundSchema = Words$inboundSchema;
440
+ /** @deprecated use `Words$outboundSchema` instead. */
441
+ export const outboundSchema = Words$outboundSchema;
442
+ /** @deprecated use `Words$Outbound` instead. */
443
+ export type Outbound = Words$Outbound;
444
+ }
445
+
446
+ export function wordsToJSON(words: Words): string {
447
+ return JSON.stringify(Words$outboundSchema.parse(words));
448
+ }
449
+
450
+ export function wordsFromJSON(
451
+ jsonString: string,
452
+ ): SafeParseResult<Words, SDKValidationError> {
453
+ return safeParse(
454
+ jsonString,
455
+ (x) => Words$inboundSchema.parse(JSON.parse(x)),
456
+ `Failed to parse 'Words' from JSON`,
457
+ );
458
+ }
459
+
460
+ /** @internal */
461
+ export const Segments$inboundSchema: z.ZodType<
462
+ Segments,
463
+ z.ZodTypeDef,
464
+ unknown
465
+ > = z.object({
466
+ id: z.number(),
467
+ seek: z.number(),
468
+ start: z.number(),
469
+ end: z.number(),
470
+ text: z.string(),
471
+ tokens: z.array(z.number()),
472
+ temperature: z.number(),
473
+ avg_logprob: z.number(),
474
+ compression_ratio: z.number(),
475
+ no_speech_prob: z.number(),
476
+ }).transform((v) => {
477
+ return remap$(v, {
478
+ "avg_logprob": "avgLogprob",
479
+ "compression_ratio": "compressionRatio",
480
+ "no_speech_prob": "noSpeechProb",
481
+ });
482
+ });
483
+
484
+ /** @internal */
485
+ export type Segments$Outbound = {
486
+ id: number;
487
+ seek: number;
488
+ start: number;
489
+ end: number;
490
+ text: string;
491
+ tokens: Array<number>;
492
+ temperature: number;
493
+ avg_logprob: number;
494
+ compression_ratio: number;
495
+ no_speech_prob: number;
496
+ };
497
+
498
+ /** @internal */
499
+ export const Segments$outboundSchema: z.ZodType<
500
+ Segments$Outbound,
501
+ z.ZodTypeDef,
502
+ Segments
503
+ > = z.object({
504
+ id: z.number(),
505
+ seek: z.number(),
506
+ start: z.number(),
507
+ end: z.number(),
508
+ text: z.string(),
509
+ tokens: z.array(z.number()),
510
+ temperature: z.number(),
511
+ avgLogprob: z.number(),
512
+ compressionRatio: z.number(),
513
+ noSpeechProb: z.number(),
514
+ }).transform((v) => {
515
+ return remap$(v, {
516
+ avgLogprob: "avg_logprob",
517
+ compressionRatio: "compression_ratio",
518
+ noSpeechProb: "no_speech_prob",
519
+ });
520
+ });
521
+
522
+ /**
523
+ * @internal
524
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
525
+ */
526
+ export namespace Segments$ {
527
+ /** @deprecated use `Segments$inboundSchema` instead. */
528
+ export const inboundSchema = Segments$inboundSchema;
529
+ /** @deprecated use `Segments$outboundSchema` instead. */
530
+ export const outboundSchema = Segments$outboundSchema;
531
+ /** @deprecated use `Segments$Outbound` instead. */
532
+ export type Outbound = Segments$Outbound;
533
+ }
534
+
535
+ export function segmentsToJSON(segments: Segments): string {
536
+ return JSON.stringify(Segments$outboundSchema.parse(segments));
537
+ }
538
+
539
+ export function segmentsFromJSON(
540
+ jsonString: string,
541
+ ): SafeParseResult<Segments, SDKValidationError> {
542
+ return safeParse(
543
+ jsonString,
544
+ (x) => Segments$inboundSchema.parse(JSON.parse(x)),
545
+ `Failed to parse 'Segments' from JSON`,
546
+ );
547
+ }
548
+
549
+ /** @internal */
550
+ export const ResponseBody2$inboundSchema: z.ZodType<
551
+ ResponseBody2,
552
+ z.ZodTypeDef,
553
+ unknown
554
+ > = z.object({
555
+ task: z.string().optional(),
556
+ language: z.string().optional(),
557
+ duration: z.number().optional(),
558
+ text: z.string(),
559
+ words: z.array(z.lazy(() => Words$inboundSchema)).optional(),
560
+ segments: z.array(z.lazy(() => Segments$inboundSchema)).optional(),
561
+ });
562
+
563
+ /** @internal */
564
+ export type ResponseBody2$Outbound = {
565
+ task?: string | undefined;
566
+ language?: string | undefined;
567
+ duration?: number | undefined;
568
+ text: string;
569
+ words?: Array<Words$Outbound> | undefined;
570
+ segments?: Array<Segments$Outbound> | undefined;
571
+ };
572
+
573
+ /** @internal */
574
+ export const ResponseBody2$outboundSchema: z.ZodType<
575
+ ResponseBody2$Outbound,
576
+ z.ZodTypeDef,
577
+ ResponseBody2
578
+ > = z.object({
579
+ task: z.string().optional(),
580
+ language: z.string().optional(),
581
+ duration: z.number().optional(),
582
+ text: z.string(),
583
+ words: z.array(z.lazy(() => Words$outboundSchema)).optional(),
584
+ segments: z.array(z.lazy(() => Segments$outboundSchema)).optional(),
585
+ });
586
+
587
+ /**
588
+ * @internal
589
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
590
+ */
591
+ export namespace ResponseBody2$ {
592
+ /** @deprecated use `ResponseBody2$inboundSchema` instead. */
593
+ export const inboundSchema = ResponseBody2$inboundSchema;
594
+ /** @deprecated use `ResponseBody2$outboundSchema` instead. */
595
+ export const outboundSchema = ResponseBody2$outboundSchema;
596
+ /** @deprecated use `ResponseBody2$Outbound` instead. */
597
+ export type Outbound = ResponseBody2$Outbound;
598
+ }
599
+
600
+ export function responseBody2ToJSON(responseBody2: ResponseBody2): string {
601
+ return JSON.stringify(ResponseBody2$outboundSchema.parse(responseBody2));
602
+ }
603
+
604
+ export function responseBody2FromJSON(
605
+ jsonString: string,
606
+ ): SafeParseResult<ResponseBody2, SDKValidationError> {
607
+ return safeParse(
608
+ jsonString,
609
+ (x) => ResponseBody2$inboundSchema.parse(JSON.parse(x)),
610
+ `Failed to parse 'ResponseBody2' from JSON`,
611
+ );
612
+ }
613
+
614
+ /** @internal */
615
+ export const ResponseBody1$inboundSchema: z.ZodType<
616
+ ResponseBody1,
617
+ z.ZodTypeDef,
618
+ unknown
619
+ > = z.object({
620
+ text: z.string(),
621
+ });
622
+
623
+ /** @internal */
624
+ export type ResponseBody1$Outbound = {
625
+ text: string;
626
+ };
627
+
628
+ /** @internal */
629
+ export const ResponseBody1$outboundSchema: z.ZodType<
630
+ ResponseBody1$Outbound,
631
+ z.ZodTypeDef,
632
+ ResponseBody1
633
+ > = z.object({
634
+ text: z.string(),
635
+ });
636
+
637
+ /**
638
+ * @internal
639
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
640
+ */
641
+ export namespace ResponseBody1$ {
642
+ /** @deprecated use `ResponseBody1$inboundSchema` instead. */
643
+ export const inboundSchema = ResponseBody1$inboundSchema;
644
+ /** @deprecated use `ResponseBody1$outboundSchema` instead. */
645
+ export const outboundSchema = ResponseBody1$outboundSchema;
646
+ /** @deprecated use `ResponseBody1$Outbound` instead. */
647
+ export type Outbound = ResponseBody1$Outbound;
648
+ }
649
+
650
+ export function responseBody1ToJSON(responseBody1: ResponseBody1): string {
651
+ return JSON.stringify(ResponseBody1$outboundSchema.parse(responseBody1));
652
+ }
653
+
654
+ export function responseBody1FromJSON(
655
+ jsonString: string,
656
+ ): SafeParseResult<ResponseBody1, SDKValidationError> {
657
+ return safeParse(
658
+ jsonString,
659
+ (x) => ResponseBody1$inboundSchema.parse(JSON.parse(x)),
660
+ `Failed to parse 'ResponseBody1' from JSON`,
661
+ );
662
+ }
663
+
664
+ /** @internal */
665
+ export const PostV2ProxyAudioTranscriptionsResponseBody$inboundSchema:
666
+ z.ZodType<PostV2ProxyAudioTranscriptionsResponseBody, z.ZodTypeDef, unknown> =
667
+ z.union([
668
+ z.lazy(() => ResponseBody1$inboundSchema),
669
+ z.lazy(() => ResponseBody2$inboundSchema),
670
+ z.string(),
671
+ ]);
672
+
673
+ /** @internal */
674
+ export type PostV2ProxyAudioTranscriptionsResponseBody$Outbound =
675
+ | ResponseBody1$Outbound
676
+ | ResponseBody2$Outbound
677
+ | string;
678
+
679
+ /** @internal */
680
+ export const PostV2ProxyAudioTranscriptionsResponseBody$outboundSchema:
681
+ z.ZodType<
682
+ PostV2ProxyAudioTranscriptionsResponseBody$Outbound,
683
+ z.ZodTypeDef,
684
+ PostV2ProxyAudioTranscriptionsResponseBody
685
+ > = z.union([
686
+ z.lazy(() => ResponseBody1$outboundSchema),
687
+ z.lazy(() => ResponseBody2$outboundSchema),
688
+ z.string(),
689
+ ]);
690
+
691
+ /**
692
+ * @internal
693
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
694
+ */
695
+ export namespace PostV2ProxyAudioTranscriptionsResponseBody$ {
696
+ /** @deprecated use `PostV2ProxyAudioTranscriptionsResponseBody$inboundSchema` instead. */
697
+ export const inboundSchema =
698
+ PostV2ProxyAudioTranscriptionsResponseBody$inboundSchema;
699
+ /** @deprecated use `PostV2ProxyAudioTranscriptionsResponseBody$outboundSchema` instead. */
700
+ export const outboundSchema =
701
+ PostV2ProxyAudioTranscriptionsResponseBody$outboundSchema;
702
+ /** @deprecated use `PostV2ProxyAudioTranscriptionsResponseBody$Outbound` instead. */
703
+ export type Outbound = PostV2ProxyAudioTranscriptionsResponseBody$Outbound;
704
+ }
705
+
706
+ export function postV2ProxyAudioTranscriptionsResponseBodyToJSON(
707
+ postV2ProxyAudioTranscriptionsResponseBody:
708
+ PostV2ProxyAudioTranscriptionsResponseBody,
709
+ ): string {
710
+ return JSON.stringify(
711
+ PostV2ProxyAudioTranscriptionsResponseBody$outboundSchema.parse(
712
+ postV2ProxyAudioTranscriptionsResponseBody,
713
+ ),
714
+ );
715
+ }
716
+
717
+ export function postV2ProxyAudioTranscriptionsResponseBodyFromJSON(
718
+ jsonString: string,
719
+ ): SafeParseResult<
720
+ PostV2ProxyAudioTranscriptionsResponseBody,
721
+ SDKValidationError
722
+ > {
723
+ return safeParse(
724
+ jsonString,
725
+ (x) =>
726
+ PostV2ProxyAudioTranscriptionsResponseBody$inboundSchema.parse(
727
+ JSON.parse(x),
728
+ ),
729
+ `Failed to parse 'PostV2ProxyAudioTranscriptionsResponseBody' from JSON`,
730
+ );
731
+ }