@orq-ai/node 3.11.7 → 3.11.9

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 (160) 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/lib/config.js.map +1 -1
  8. package/mcp-server/mcp-server.js +1 -1
  9. package/mcp-server/server.js +1 -1
  10. package/models/operations/createcontact.js +2 -2
  11. package/models/operations/createdataset.js +2 -2
  12. package/models/operations/createdatasetitem.js +2 -2
  13. package/models/operations/createdatasource.js +2 -2
  14. package/models/operations/createeval.js +16 -16
  15. package/models/operations/fileget.js +2 -2
  16. package/models/operations/filelist.js +2 -2
  17. package/models/operations/fileupload.js +2 -2
  18. package/models/operations/getevals.js +28 -28
  19. package/models/operations/listcontacts.js +2 -2
  20. package/models/operations/listdatasetdatapoints.js +2 -2
  21. package/models/operations/listdatasets.js +2 -2
  22. package/models/operations/listdatasources.js +2 -2
  23. package/models/operations/retrievecontact.js +2 -2
  24. package/models/operations/retrievedatapoint.js +2 -2
  25. package/models/operations/retrievedataset.js +2 -2
  26. package/models/operations/retrievedatasource.js +2 -2
  27. package/models/operations/updatecontact.js +2 -2
  28. package/models/operations/updatedatapoint.js +2 -2
  29. package/models/operations/updatedataset.js +2 -2
  30. package/models/operations/updatedatasource.js +2 -2
  31. package/models/operations/updateeval.js +16 -16
  32. package/package.json +1 -1
  33. package/packages/orq-rc/README.md +128 -87
  34. package/packages/orq-rc/docs/sdks/batches/README.md +307 -0
  35. package/packages/orq-rc/docs/sdks/knowledge/README.md +1 -1
  36. package/packages/orq-rc/docs/sdks/proxy/README.md +1284 -0
  37. package/packages/orq-rc/examples/package-lock.json +1 -1
  38. package/packages/orq-rc/jsr.json +1 -1
  39. package/packages/orq-rc/package-lock.json +2 -2
  40. package/packages/orq-rc/package.json +1 -1
  41. package/packages/orq-rc/src/funcs/batchesCancel.ts +166 -0
  42. package/packages/orq-rc/src/funcs/batchesCreate.ts +160 -0
  43. package/packages/orq-rc/src/funcs/batchesList.ts +165 -0
  44. package/packages/orq-rc/src/funcs/batchesRetrieve.ts +166 -0
  45. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +1 -1
  46. package/packages/orq-rc/src/funcs/proxyAudioSpeech.ts +159 -0
  47. package/packages/orq-rc/src/funcs/proxyAudioTranscriptions.ts +233 -0
  48. package/packages/orq-rc/src/funcs/proxyAudioTranslations.ts +223 -0
  49. package/packages/orq-rc/src/funcs/proxyChatCompletions.ts +172 -0
  50. package/packages/orq-rc/src/funcs/proxyCompletions.ts +168 -0
  51. package/packages/orq-rc/src/funcs/proxyEmbeddings.ts +161 -0
  52. package/packages/orq-rc/src/funcs/proxyImagesEdit.ts +173 -0
  53. package/packages/orq-rc/src/funcs/proxyImagesGenerate.ts +163 -0
  54. package/packages/orq-rc/src/funcs/proxyImagesVariation.ts +179 -0
  55. package/packages/orq-rc/src/funcs/proxyModerations.ts +164 -0
  56. package/packages/orq-rc/src/funcs/proxyRerank.ts +158 -0
  57. package/packages/orq-rc/src/funcs/proxyResponsesCreate.ts +171 -0
  58. package/packages/orq-rc/src/lib/config.ts +3 -3
  59. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  60. package/packages/orq-rc/src/mcp-server/server.ts +33 -1
  61. package/packages/orq-rc/src/mcp-server/tools/batchesCancel.ts +37 -0
  62. package/packages/orq-rc/src/mcp-server/tools/batchesCreate.ts +37 -0
  63. package/packages/orq-rc/src/mcp-server/tools/batchesList.ts +37 -0
  64. package/packages/orq-rc/src/mcp-server/tools/batchesRetrieve.ts +37 -0
  65. package/packages/orq-rc/src/mcp-server/tools/knowledgeSearch.ts +1 -1
  66. package/packages/orq-rc/src/mcp-server/tools/proxyAudioSpeech.ts +33 -0
  67. package/packages/orq-rc/src/mcp-server/tools/proxyAudioTranscriptions.ts +35 -0
  68. package/packages/orq-rc/src/mcp-server/tools/proxyAudioTranslations.ts +35 -0
  69. package/packages/orq-rc/src/mcp-server/tools/proxyChatCompletions.ts +37 -0
  70. package/packages/orq-rc/src/mcp-server/tools/proxyCompletions.ts +37 -0
  71. package/packages/orq-rc/src/mcp-server/tools/proxyEmbeddings.ts +37 -0
  72. package/packages/orq-rc/src/mcp-server/tools/proxyImagesEdit.ts +35 -0
  73. package/packages/orq-rc/src/mcp-server/tools/proxyImagesGenerate.ts +35 -0
  74. package/packages/orq-rc/src/mcp-server/tools/proxyImagesVariation.ts +35 -0
  75. package/packages/orq-rc/src/mcp-server/tools/proxyModerations.ts +35 -0
  76. package/packages/orq-rc/src/mcp-server/tools/proxyRerank.ts +36 -0
  77. package/packages/orq-rc/src/mcp-server/tools/proxyResponsesCreate.ts +37 -0
  78. package/packages/orq-rc/src/models/components/deployments.ts +861 -0
  79. package/packages/orq-rc/src/models/components/index.ts +1 -0
  80. package/packages/orq-rc/src/models/components/publiccontact.ts +114 -0
  81. package/packages/orq-rc/src/models/errors/index.ts +3 -0
  82. package/packages/orq-rc/src/models/errors/postv2proxyaudiotranscriptions.ts +163 -0
  83. package/packages/orq-rc/src/models/errors/postv2proxyaudiotranslations.ts +162 -0
  84. package/packages/orq-rc/src/models/errors/postv2proxymoderations.ts +151 -0
  85. package/packages/orq-rc/src/models/operations/cancelbatch.ts +474 -0
  86. package/packages/orq-rc/src/models/operations/createbatch.ts +531 -0
  87. package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
  88. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +11697 -0
  89. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  90. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  91. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2205 -1224
  92. package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
  93. package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
  94. package/packages/orq-rc/src/models/operations/createresponse.ts +6908 -0
  95. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +2282 -1214
  96. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +938 -51
  97. package/packages/orq-rc/src/models/operations/deploymentstream.ts +1471 -305
  98. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  99. package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
  100. package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
  101. package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
  102. package/packages/orq-rc/src/models/operations/getevals.ts +107 -92
  103. package/packages/orq-rc/src/models/operations/index.ts +16 -0
  104. package/packages/orq-rc/src/models/operations/listbatches.ts +570 -0
  105. package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
  106. package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
  107. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +498 -2
  108. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  109. package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
  110. package/packages/orq-rc/src/models/operations/postv2proxyaudiospeech.ts +393 -0
  111. package/packages/orq-rc/src/models/operations/postv2proxyaudiotranscriptions.ts +731 -0
  112. package/packages/orq-rc/src/models/operations/postv2proxyaudiotranslations.ts +741 -0
  113. package/packages/orq-rc/src/models/operations/postv2proxycompletions.ts +5831 -0
  114. package/packages/orq-rc/src/models/operations/postv2proxyembeddings.ts +878 -0
  115. package/packages/orq-rc/src/models/operations/postv2proxyimagesedits.ts +596 -0
  116. package/packages/orq-rc/src/models/operations/postv2proxyimagesgenerations.ts +1107 -0
  117. package/packages/orq-rc/src/models/operations/postv2proxyimagesvariations.ts +592 -0
  118. package/packages/orq-rc/src/models/operations/postv2proxymoderations.ts +802 -0
  119. package/packages/orq-rc/src/models/operations/postv2proxyrerank.ts +526 -0
  120. package/packages/orq-rc/src/models/operations/retrievebatch.ts +474 -0
  121. package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
  122. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +478 -2
  123. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  124. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
  125. package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -2
  126. package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
  127. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +974 -2
  128. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  129. package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
  130. package/packages/orq-rc/src/models/operations/updateeval.ts +16 -16
  131. package/packages/orq-rc/src/sdk/batches.ts +81 -0
  132. package/packages/orq-rc/src/sdk/knowledge.ts +1 -1
  133. package/packages/orq-rc/src/sdk/proxy.ts +211 -0
  134. package/packages/orq-rc/src/sdk/sdk.ts +12 -0
  135. package/packages/orq-rc/temp/example.ts +5 -0
  136. package/src/lib/config.ts +3 -3
  137. package/src/mcp-server/mcp-server.ts +1 -1
  138. package/src/mcp-server/server.ts +1 -1
  139. package/src/models/operations/createcontact.ts +2 -2
  140. package/src/models/operations/createdataset.ts +2 -2
  141. package/src/models/operations/createdatasetitem.ts +2 -2
  142. package/src/models/operations/createdatasource.ts +2 -2
  143. package/src/models/operations/createeval.ts +16 -16
  144. package/src/models/operations/fileget.ts +2 -2
  145. package/src/models/operations/filelist.ts +2 -2
  146. package/src/models/operations/fileupload.ts +2 -2
  147. package/src/models/operations/getevals.ts +28 -28
  148. package/src/models/operations/listcontacts.ts +2 -2
  149. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  150. package/src/models/operations/listdatasets.ts +2 -2
  151. package/src/models/operations/listdatasources.ts +2 -2
  152. package/src/models/operations/retrievecontact.ts +2 -2
  153. package/src/models/operations/retrievedatapoint.ts +2 -2
  154. package/src/models/operations/retrievedataset.ts +2 -2
  155. package/src/models/operations/retrievedatasource.ts +2 -2
  156. package/src/models/operations/updatecontact.ts +2 -2
  157. package/src/models/operations/updatedatapoint.ts +2 -2
  158. package/src/models/operations/updatedataset.ts +2 -2
  159. package/src/models/operations/updatedatasource.ts +2 -2
  160. package/src/models/operations/updateeval.ts +16 -16
@@ -0,0 +1,596 @@
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 { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * The image(s) to edit. Must be a supported image file or an array of images. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images.
14
+ */
15
+ export type Image = any | Array<any>;
16
+
17
+ /**
18
+ * The format in which the generated images are returned. Some of the models only return the image in base64 format.
19
+ */
20
+ export const PostV2ProxyImagesEditsResponseFormat = {
21
+ Url: "url",
22
+ B64Json: "b64_json",
23
+ } as const;
24
+ /**
25
+ * The format in which the generated images are returned. Some of the models only return the image in base64 format.
26
+ */
27
+ export type PostV2ProxyImagesEditsResponseFormat = ClosedEnum<
28
+ typeof PostV2ProxyImagesEditsResponseFormat
29
+ >;
30
+
31
+ export type PostV2ProxyImagesEditsRequestBody = {
32
+ /**
33
+ * The model to use for image generation. [Check models](https://docs.orq.ai/docs/proxy#/image-models)
34
+ */
35
+ model: string;
36
+ /**
37
+ * The image(s) to edit. Must be a supported image file or an array of images. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images.
38
+ */
39
+ image?: any | Array<any> | undefined;
40
+ /**
41
+ * A text description of the desired image(s).
42
+ */
43
+ prompt: string;
44
+ /**
45
+ * The number of images to generate. Must be between 1 and 10.
46
+ */
47
+ n?: number | null | undefined;
48
+ /**
49
+ * The size of the generated images
50
+ */
51
+ size?: string | null | undefined;
52
+ /**
53
+ * The format in which the generated images are returned. Some of the models only return the image in base64 format.
54
+ */
55
+ responseFormat?: PostV2ProxyImagesEditsResponseFormat | null | undefined;
56
+ /**
57
+ * A unique identifier representing your end-user, which can help to monitor and detect abuse.
58
+ */
59
+ user?: string | undefined;
60
+ };
61
+
62
+ export type PostV2ProxyImagesEditsData = {
63
+ /**
64
+ * The base64-encoded JSON of the generated image, if response_format is b64_json
65
+ */
66
+ b64Json?: string | undefined;
67
+ /**
68
+ * The URL of the generated image, if response_format is url (default)
69
+ */
70
+ url?: string | undefined;
71
+ };
72
+
73
+ /**
74
+ * The input tokens detailed information for the image generation.
75
+ */
76
+ export type PostV2ProxyImagesEditsInputTokensDetails = {
77
+ /**
78
+ * The number of text tokens in the input prompt.
79
+ */
80
+ textTokens: number;
81
+ /**
82
+ * The number of image tokens in the input prompt.
83
+ */
84
+ imageTokens: number;
85
+ };
86
+
87
+ /**
88
+ * The token usage information for the image generation.
89
+ */
90
+ export type PostV2ProxyImagesEditsUsage = {
91
+ /**
92
+ * The total number of tokens (images and text) used for the image generation.
93
+ */
94
+ totalTokens: number;
95
+ /**
96
+ * The number of tokens (images and text) in the input prompt.
97
+ */
98
+ inputTokens: number;
99
+ /**
100
+ * The number of output tokens generated by the model.
101
+ */
102
+ outputTokens: number;
103
+ /**
104
+ * The input tokens detailed information for the image generation.
105
+ */
106
+ inputTokensDetails: PostV2ProxyImagesEditsInputTokensDetails;
107
+ };
108
+
109
+ /**
110
+ * Represents an image edit response from the API.
111
+ */
112
+ export type PostV2ProxyImagesEditsResponseBody = {
113
+ /**
114
+ * The Unix timestamp (in seconds) of when the image was created.
115
+ */
116
+ created: number;
117
+ /**
118
+ * The output format of the image generation
119
+ */
120
+ outputFormat?: string | undefined;
121
+ /**
122
+ * The size of the image generated
123
+ */
124
+ size?: string | undefined;
125
+ /**
126
+ * The quality of the image generated
127
+ */
128
+ quality?: string | undefined;
129
+ /**
130
+ * The list of generated images.
131
+ */
132
+ data: Array<PostV2ProxyImagesEditsData>;
133
+ /**
134
+ * The token usage information for the image generation.
135
+ */
136
+ usage?: PostV2ProxyImagesEditsUsage | undefined;
137
+ };
138
+
139
+ /** @internal */
140
+ export const Image$inboundSchema: z.ZodType<Image, z.ZodTypeDef, unknown> = z
141
+ .union([z.any(), z.array(z.any())]);
142
+
143
+ /** @internal */
144
+ export type Image$Outbound = any | Array<any>;
145
+
146
+ /** @internal */
147
+ export const Image$outboundSchema: z.ZodType<
148
+ Image$Outbound,
149
+ z.ZodTypeDef,
150
+ Image
151
+ > = z.union([z.any(), z.array(z.any())]);
152
+
153
+ /**
154
+ * @internal
155
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
156
+ */
157
+ export namespace Image$ {
158
+ /** @deprecated use `Image$inboundSchema` instead. */
159
+ export const inboundSchema = Image$inboundSchema;
160
+ /** @deprecated use `Image$outboundSchema` instead. */
161
+ export const outboundSchema = Image$outboundSchema;
162
+ /** @deprecated use `Image$Outbound` instead. */
163
+ export type Outbound = Image$Outbound;
164
+ }
165
+
166
+ export function imageToJSON(image: Image): string {
167
+ return JSON.stringify(Image$outboundSchema.parse(image));
168
+ }
169
+
170
+ export function imageFromJSON(
171
+ jsonString: string,
172
+ ): SafeParseResult<Image, SDKValidationError> {
173
+ return safeParse(
174
+ jsonString,
175
+ (x) => Image$inboundSchema.parse(JSON.parse(x)),
176
+ `Failed to parse 'Image' from JSON`,
177
+ );
178
+ }
179
+
180
+ /** @internal */
181
+ export const PostV2ProxyImagesEditsResponseFormat$inboundSchema:
182
+ z.ZodNativeEnum<typeof PostV2ProxyImagesEditsResponseFormat> = z.nativeEnum(
183
+ PostV2ProxyImagesEditsResponseFormat,
184
+ );
185
+
186
+ /** @internal */
187
+ export const PostV2ProxyImagesEditsResponseFormat$outboundSchema:
188
+ z.ZodNativeEnum<typeof PostV2ProxyImagesEditsResponseFormat> =
189
+ PostV2ProxyImagesEditsResponseFormat$inboundSchema;
190
+
191
+ /**
192
+ * @internal
193
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
194
+ */
195
+ export namespace PostV2ProxyImagesEditsResponseFormat$ {
196
+ /** @deprecated use `PostV2ProxyImagesEditsResponseFormat$inboundSchema` instead. */
197
+ export const inboundSchema =
198
+ PostV2ProxyImagesEditsResponseFormat$inboundSchema;
199
+ /** @deprecated use `PostV2ProxyImagesEditsResponseFormat$outboundSchema` instead. */
200
+ export const outboundSchema =
201
+ PostV2ProxyImagesEditsResponseFormat$outboundSchema;
202
+ }
203
+
204
+ /** @internal */
205
+ export const PostV2ProxyImagesEditsRequestBody$inboundSchema: z.ZodType<
206
+ PostV2ProxyImagesEditsRequestBody,
207
+ z.ZodTypeDef,
208
+ unknown
209
+ > = z.object({
210
+ model: z.string(),
211
+ image: z.union([z.any(), z.array(z.any())]).optional(),
212
+ prompt: z.string(),
213
+ n: z.nullable(z.number().int().default(1)),
214
+ size: z.nullable(z.string()).optional(),
215
+ response_format: z.nullable(
216
+ PostV2ProxyImagesEditsResponseFormat$inboundSchema.default("url"),
217
+ ),
218
+ user: z.string().optional(),
219
+ }).transform((v) => {
220
+ return remap$(v, {
221
+ "response_format": "responseFormat",
222
+ });
223
+ });
224
+
225
+ /** @internal */
226
+ export type PostV2ProxyImagesEditsRequestBody$Outbound = {
227
+ model: string;
228
+ image?: any | Array<any> | undefined;
229
+ prompt: string;
230
+ n: number | null;
231
+ size?: string | null | undefined;
232
+ response_format: string | null;
233
+ user?: string | undefined;
234
+ };
235
+
236
+ /** @internal */
237
+ export const PostV2ProxyImagesEditsRequestBody$outboundSchema: z.ZodType<
238
+ PostV2ProxyImagesEditsRequestBody$Outbound,
239
+ z.ZodTypeDef,
240
+ PostV2ProxyImagesEditsRequestBody
241
+ > = z.object({
242
+ model: z.string(),
243
+ image: z.union([z.any(), z.array(z.any())]).optional(),
244
+ prompt: z.string(),
245
+ n: z.nullable(z.number().int().default(1)),
246
+ size: z.nullable(z.string()).optional(),
247
+ responseFormat: z.nullable(
248
+ PostV2ProxyImagesEditsResponseFormat$outboundSchema.default("url"),
249
+ ),
250
+ user: z.string().optional(),
251
+ }).transform((v) => {
252
+ return remap$(v, {
253
+ responseFormat: "response_format",
254
+ });
255
+ });
256
+
257
+ /**
258
+ * @internal
259
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
260
+ */
261
+ export namespace PostV2ProxyImagesEditsRequestBody$ {
262
+ /** @deprecated use `PostV2ProxyImagesEditsRequestBody$inboundSchema` instead. */
263
+ export const inboundSchema = PostV2ProxyImagesEditsRequestBody$inboundSchema;
264
+ /** @deprecated use `PostV2ProxyImagesEditsRequestBody$outboundSchema` instead. */
265
+ export const outboundSchema =
266
+ PostV2ProxyImagesEditsRequestBody$outboundSchema;
267
+ /** @deprecated use `PostV2ProxyImagesEditsRequestBody$Outbound` instead. */
268
+ export type Outbound = PostV2ProxyImagesEditsRequestBody$Outbound;
269
+ }
270
+
271
+ export function postV2ProxyImagesEditsRequestBodyToJSON(
272
+ postV2ProxyImagesEditsRequestBody: PostV2ProxyImagesEditsRequestBody,
273
+ ): string {
274
+ return JSON.stringify(
275
+ PostV2ProxyImagesEditsRequestBody$outboundSchema.parse(
276
+ postV2ProxyImagesEditsRequestBody,
277
+ ),
278
+ );
279
+ }
280
+
281
+ export function postV2ProxyImagesEditsRequestBodyFromJSON(
282
+ jsonString: string,
283
+ ): SafeParseResult<PostV2ProxyImagesEditsRequestBody, SDKValidationError> {
284
+ return safeParse(
285
+ jsonString,
286
+ (x) => PostV2ProxyImagesEditsRequestBody$inboundSchema.parse(JSON.parse(x)),
287
+ `Failed to parse 'PostV2ProxyImagesEditsRequestBody' from JSON`,
288
+ );
289
+ }
290
+
291
+ /** @internal */
292
+ export const PostV2ProxyImagesEditsData$inboundSchema: z.ZodType<
293
+ PostV2ProxyImagesEditsData,
294
+ z.ZodTypeDef,
295
+ unknown
296
+ > = z.object({
297
+ b64_json: z.string().optional(),
298
+ url: z.string().optional(),
299
+ }).transform((v) => {
300
+ return remap$(v, {
301
+ "b64_json": "b64Json",
302
+ });
303
+ });
304
+
305
+ /** @internal */
306
+ export type PostV2ProxyImagesEditsData$Outbound = {
307
+ b64_json?: string | undefined;
308
+ url?: string | undefined;
309
+ };
310
+
311
+ /** @internal */
312
+ export const PostV2ProxyImagesEditsData$outboundSchema: z.ZodType<
313
+ PostV2ProxyImagesEditsData$Outbound,
314
+ z.ZodTypeDef,
315
+ PostV2ProxyImagesEditsData
316
+ > = z.object({
317
+ b64Json: z.string().optional(),
318
+ url: z.string().optional(),
319
+ }).transform((v) => {
320
+ return remap$(v, {
321
+ b64Json: "b64_json",
322
+ });
323
+ });
324
+
325
+ /**
326
+ * @internal
327
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
328
+ */
329
+ export namespace PostV2ProxyImagesEditsData$ {
330
+ /** @deprecated use `PostV2ProxyImagesEditsData$inboundSchema` instead. */
331
+ export const inboundSchema = PostV2ProxyImagesEditsData$inboundSchema;
332
+ /** @deprecated use `PostV2ProxyImagesEditsData$outboundSchema` instead. */
333
+ export const outboundSchema = PostV2ProxyImagesEditsData$outboundSchema;
334
+ /** @deprecated use `PostV2ProxyImagesEditsData$Outbound` instead. */
335
+ export type Outbound = PostV2ProxyImagesEditsData$Outbound;
336
+ }
337
+
338
+ export function postV2ProxyImagesEditsDataToJSON(
339
+ postV2ProxyImagesEditsData: PostV2ProxyImagesEditsData,
340
+ ): string {
341
+ return JSON.stringify(
342
+ PostV2ProxyImagesEditsData$outboundSchema.parse(postV2ProxyImagesEditsData),
343
+ );
344
+ }
345
+
346
+ export function postV2ProxyImagesEditsDataFromJSON(
347
+ jsonString: string,
348
+ ): SafeParseResult<PostV2ProxyImagesEditsData, SDKValidationError> {
349
+ return safeParse(
350
+ jsonString,
351
+ (x) => PostV2ProxyImagesEditsData$inboundSchema.parse(JSON.parse(x)),
352
+ `Failed to parse 'PostV2ProxyImagesEditsData' from JSON`,
353
+ );
354
+ }
355
+
356
+ /** @internal */
357
+ export const PostV2ProxyImagesEditsInputTokensDetails$inboundSchema: z.ZodType<
358
+ PostV2ProxyImagesEditsInputTokensDetails,
359
+ z.ZodTypeDef,
360
+ unknown
361
+ > = z.object({
362
+ text_tokens: z.number(),
363
+ image_tokens: z.number(),
364
+ }).transform((v) => {
365
+ return remap$(v, {
366
+ "text_tokens": "textTokens",
367
+ "image_tokens": "imageTokens",
368
+ });
369
+ });
370
+
371
+ /** @internal */
372
+ export type PostV2ProxyImagesEditsInputTokensDetails$Outbound = {
373
+ text_tokens: number;
374
+ image_tokens: number;
375
+ };
376
+
377
+ /** @internal */
378
+ export const PostV2ProxyImagesEditsInputTokensDetails$outboundSchema: z.ZodType<
379
+ PostV2ProxyImagesEditsInputTokensDetails$Outbound,
380
+ z.ZodTypeDef,
381
+ PostV2ProxyImagesEditsInputTokensDetails
382
+ > = z.object({
383
+ textTokens: z.number(),
384
+ imageTokens: z.number(),
385
+ }).transform((v) => {
386
+ return remap$(v, {
387
+ textTokens: "text_tokens",
388
+ imageTokens: "image_tokens",
389
+ });
390
+ });
391
+
392
+ /**
393
+ * @internal
394
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
395
+ */
396
+ export namespace PostV2ProxyImagesEditsInputTokensDetails$ {
397
+ /** @deprecated use `PostV2ProxyImagesEditsInputTokensDetails$inboundSchema` instead. */
398
+ export const inboundSchema =
399
+ PostV2ProxyImagesEditsInputTokensDetails$inboundSchema;
400
+ /** @deprecated use `PostV2ProxyImagesEditsInputTokensDetails$outboundSchema` instead. */
401
+ export const outboundSchema =
402
+ PostV2ProxyImagesEditsInputTokensDetails$outboundSchema;
403
+ /** @deprecated use `PostV2ProxyImagesEditsInputTokensDetails$Outbound` instead. */
404
+ export type Outbound = PostV2ProxyImagesEditsInputTokensDetails$Outbound;
405
+ }
406
+
407
+ export function postV2ProxyImagesEditsInputTokensDetailsToJSON(
408
+ postV2ProxyImagesEditsInputTokensDetails:
409
+ PostV2ProxyImagesEditsInputTokensDetails,
410
+ ): string {
411
+ return JSON.stringify(
412
+ PostV2ProxyImagesEditsInputTokensDetails$outboundSchema.parse(
413
+ postV2ProxyImagesEditsInputTokensDetails,
414
+ ),
415
+ );
416
+ }
417
+
418
+ export function postV2ProxyImagesEditsInputTokensDetailsFromJSON(
419
+ jsonString: string,
420
+ ): SafeParseResult<
421
+ PostV2ProxyImagesEditsInputTokensDetails,
422
+ SDKValidationError
423
+ > {
424
+ return safeParse(
425
+ jsonString,
426
+ (x) =>
427
+ PostV2ProxyImagesEditsInputTokensDetails$inboundSchema.parse(
428
+ JSON.parse(x),
429
+ ),
430
+ `Failed to parse 'PostV2ProxyImagesEditsInputTokensDetails' from JSON`,
431
+ );
432
+ }
433
+
434
+ /** @internal */
435
+ export const PostV2ProxyImagesEditsUsage$inboundSchema: z.ZodType<
436
+ PostV2ProxyImagesEditsUsage,
437
+ z.ZodTypeDef,
438
+ unknown
439
+ > = z.object({
440
+ total_tokens: z.number(),
441
+ input_tokens: z.number(),
442
+ output_tokens: z.number(),
443
+ input_tokens_details: z.lazy(() =>
444
+ PostV2ProxyImagesEditsInputTokensDetails$inboundSchema
445
+ ),
446
+ }).transform((v) => {
447
+ return remap$(v, {
448
+ "total_tokens": "totalTokens",
449
+ "input_tokens": "inputTokens",
450
+ "output_tokens": "outputTokens",
451
+ "input_tokens_details": "inputTokensDetails",
452
+ });
453
+ });
454
+
455
+ /** @internal */
456
+ export type PostV2ProxyImagesEditsUsage$Outbound = {
457
+ total_tokens: number;
458
+ input_tokens: number;
459
+ output_tokens: number;
460
+ input_tokens_details: PostV2ProxyImagesEditsInputTokensDetails$Outbound;
461
+ };
462
+
463
+ /** @internal */
464
+ export const PostV2ProxyImagesEditsUsage$outboundSchema: z.ZodType<
465
+ PostV2ProxyImagesEditsUsage$Outbound,
466
+ z.ZodTypeDef,
467
+ PostV2ProxyImagesEditsUsage
468
+ > = z.object({
469
+ totalTokens: z.number(),
470
+ inputTokens: z.number(),
471
+ outputTokens: z.number(),
472
+ inputTokensDetails: z.lazy(() =>
473
+ PostV2ProxyImagesEditsInputTokensDetails$outboundSchema
474
+ ),
475
+ }).transform((v) => {
476
+ return remap$(v, {
477
+ totalTokens: "total_tokens",
478
+ inputTokens: "input_tokens",
479
+ outputTokens: "output_tokens",
480
+ inputTokensDetails: "input_tokens_details",
481
+ });
482
+ });
483
+
484
+ /**
485
+ * @internal
486
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
487
+ */
488
+ export namespace PostV2ProxyImagesEditsUsage$ {
489
+ /** @deprecated use `PostV2ProxyImagesEditsUsage$inboundSchema` instead. */
490
+ export const inboundSchema = PostV2ProxyImagesEditsUsage$inboundSchema;
491
+ /** @deprecated use `PostV2ProxyImagesEditsUsage$outboundSchema` instead. */
492
+ export const outboundSchema = PostV2ProxyImagesEditsUsage$outboundSchema;
493
+ /** @deprecated use `PostV2ProxyImagesEditsUsage$Outbound` instead. */
494
+ export type Outbound = PostV2ProxyImagesEditsUsage$Outbound;
495
+ }
496
+
497
+ export function postV2ProxyImagesEditsUsageToJSON(
498
+ postV2ProxyImagesEditsUsage: PostV2ProxyImagesEditsUsage,
499
+ ): string {
500
+ return JSON.stringify(
501
+ PostV2ProxyImagesEditsUsage$outboundSchema.parse(
502
+ postV2ProxyImagesEditsUsage,
503
+ ),
504
+ );
505
+ }
506
+
507
+ export function postV2ProxyImagesEditsUsageFromJSON(
508
+ jsonString: string,
509
+ ): SafeParseResult<PostV2ProxyImagesEditsUsage, SDKValidationError> {
510
+ return safeParse(
511
+ jsonString,
512
+ (x) => PostV2ProxyImagesEditsUsage$inboundSchema.parse(JSON.parse(x)),
513
+ `Failed to parse 'PostV2ProxyImagesEditsUsage' from JSON`,
514
+ );
515
+ }
516
+
517
+ /** @internal */
518
+ export const PostV2ProxyImagesEditsResponseBody$inboundSchema: z.ZodType<
519
+ PostV2ProxyImagesEditsResponseBody,
520
+ z.ZodTypeDef,
521
+ unknown
522
+ > = z.object({
523
+ created: z.number(),
524
+ output_format: z.string().optional(),
525
+ size: z.string().optional(),
526
+ quality: z.string().optional(),
527
+ data: z.array(z.lazy(() => PostV2ProxyImagesEditsData$inboundSchema)),
528
+ usage: z.lazy(() => PostV2ProxyImagesEditsUsage$inboundSchema).optional(),
529
+ }).transform((v) => {
530
+ return remap$(v, {
531
+ "output_format": "outputFormat",
532
+ });
533
+ });
534
+
535
+ /** @internal */
536
+ export type PostV2ProxyImagesEditsResponseBody$Outbound = {
537
+ created: number;
538
+ output_format?: string | undefined;
539
+ size?: string | undefined;
540
+ quality?: string | undefined;
541
+ data: Array<PostV2ProxyImagesEditsData$Outbound>;
542
+ usage?: PostV2ProxyImagesEditsUsage$Outbound | undefined;
543
+ };
544
+
545
+ /** @internal */
546
+ export const PostV2ProxyImagesEditsResponseBody$outboundSchema: z.ZodType<
547
+ PostV2ProxyImagesEditsResponseBody$Outbound,
548
+ z.ZodTypeDef,
549
+ PostV2ProxyImagesEditsResponseBody
550
+ > = z.object({
551
+ created: z.number(),
552
+ outputFormat: z.string().optional(),
553
+ size: z.string().optional(),
554
+ quality: z.string().optional(),
555
+ data: z.array(z.lazy(() => PostV2ProxyImagesEditsData$outboundSchema)),
556
+ usage: z.lazy(() => PostV2ProxyImagesEditsUsage$outboundSchema).optional(),
557
+ }).transform((v) => {
558
+ return remap$(v, {
559
+ outputFormat: "output_format",
560
+ });
561
+ });
562
+
563
+ /**
564
+ * @internal
565
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
566
+ */
567
+ export namespace PostV2ProxyImagesEditsResponseBody$ {
568
+ /** @deprecated use `PostV2ProxyImagesEditsResponseBody$inboundSchema` instead. */
569
+ export const inboundSchema = PostV2ProxyImagesEditsResponseBody$inboundSchema;
570
+ /** @deprecated use `PostV2ProxyImagesEditsResponseBody$outboundSchema` instead. */
571
+ export const outboundSchema =
572
+ PostV2ProxyImagesEditsResponseBody$outboundSchema;
573
+ /** @deprecated use `PostV2ProxyImagesEditsResponseBody$Outbound` instead. */
574
+ export type Outbound = PostV2ProxyImagesEditsResponseBody$Outbound;
575
+ }
576
+
577
+ export function postV2ProxyImagesEditsResponseBodyToJSON(
578
+ postV2ProxyImagesEditsResponseBody: PostV2ProxyImagesEditsResponseBody,
579
+ ): string {
580
+ return JSON.stringify(
581
+ PostV2ProxyImagesEditsResponseBody$outboundSchema.parse(
582
+ postV2ProxyImagesEditsResponseBody,
583
+ ),
584
+ );
585
+ }
586
+
587
+ export function postV2ProxyImagesEditsResponseBodyFromJSON(
588
+ jsonString: string,
589
+ ): SafeParseResult<PostV2ProxyImagesEditsResponseBody, SDKValidationError> {
590
+ return safeParse(
591
+ jsonString,
592
+ (x) =>
593
+ PostV2ProxyImagesEditsResponseBody$inboundSchema.parse(JSON.parse(x)),
594
+ `Failed to parse 'PostV2ProxyImagesEditsResponseBody' from JSON`,
595
+ );
596
+ }