@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,543 @@
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
+ * Input text to embed, encoded as a string or array of tokens.
14
+ */
15
+ export type PostV2ProxyEmbeddingsInput = string | Array<string>;
16
+
17
+ /**
18
+ * Type of the document element
19
+ */
20
+ export const PostV2ProxyEmbeddingsEncodingFormat = {
21
+ Base64: "base64",
22
+ Float: "float",
23
+ } as const;
24
+ /**
25
+ * Type of the document element
26
+ */
27
+ export type PostV2ProxyEmbeddingsEncodingFormat = ClosedEnum<
28
+ typeof PostV2ProxyEmbeddingsEncodingFormat
29
+ >;
30
+
31
+ /**
32
+ * input
33
+ */
34
+ export type PostV2ProxyEmbeddingsRequestBody = {
35
+ /**
36
+ * Input text to embed, encoded as a string or array of tokens.
37
+ */
38
+ input: string | Array<string>;
39
+ /**
40
+ * ID of the model to use
41
+ */
42
+ model: string;
43
+ /**
44
+ * Type of the document element
45
+ */
46
+ encodingFormat?: PostV2ProxyEmbeddingsEncodingFormat | undefined;
47
+ /**
48
+ * The number of dimensions the resulting output embeddings should have.
49
+ */
50
+ dimensions?: number | undefined;
51
+ /**
52
+ * A unique identifier representing your end-user
53
+ */
54
+ user?: string | undefined;
55
+ };
56
+
57
+ export const PostV2ProxyEmbeddingsObject = {
58
+ List: "list",
59
+ } as const;
60
+ export type PostV2ProxyEmbeddingsObject = ClosedEnum<
61
+ typeof PostV2ProxyEmbeddingsObject
62
+ >;
63
+
64
+ /**
65
+ * The object type, which is always `embedding`.
66
+ */
67
+ export const PostV2ProxyEmbeddingsProxyObject = {
68
+ Embedding: "embedding",
69
+ } as const;
70
+ /**
71
+ * The object type, which is always `embedding`.
72
+ */
73
+ export type PostV2ProxyEmbeddingsProxyObject = ClosedEnum<
74
+ typeof PostV2ProxyEmbeddingsProxyObject
75
+ >;
76
+
77
+ /**
78
+ * The embedding vector, which is a list of floats. The length of vector depends on the model.
79
+ */
80
+ export type Embedding = Array<number> | string;
81
+
82
+ export type PostV2ProxyEmbeddingsData = {
83
+ /**
84
+ * The object type, which is always `embedding`.
85
+ */
86
+ object: PostV2ProxyEmbeddingsProxyObject;
87
+ /**
88
+ * The embedding vector, which is a list of floats. The length of vector depends on the model.
89
+ */
90
+ embedding: Array<number> | string;
91
+ /**
92
+ * The index of the embedding in the list of embeddings.
93
+ */
94
+ index: number;
95
+ };
96
+
97
+ export type PostV2ProxyEmbeddingsUsage = {
98
+ promptTokens: number;
99
+ totalTokens: number;
100
+ };
101
+
102
+ /**
103
+ * Returns the embedding vector.
104
+ */
105
+ export type PostV2ProxyEmbeddingsResponseBody = {
106
+ object: PostV2ProxyEmbeddingsObject;
107
+ data: Array<PostV2ProxyEmbeddingsData>;
108
+ /**
109
+ * ID of the model to used.
110
+ */
111
+ model: string;
112
+ usage?: PostV2ProxyEmbeddingsUsage | undefined;
113
+ };
114
+
115
+ /** @internal */
116
+ export const PostV2ProxyEmbeddingsInput$inboundSchema: z.ZodType<
117
+ PostV2ProxyEmbeddingsInput,
118
+ z.ZodTypeDef,
119
+ unknown
120
+ > = z.union([z.string(), z.array(z.string())]);
121
+
122
+ /** @internal */
123
+ export type PostV2ProxyEmbeddingsInput$Outbound = string | Array<string>;
124
+
125
+ /** @internal */
126
+ export const PostV2ProxyEmbeddingsInput$outboundSchema: z.ZodType<
127
+ PostV2ProxyEmbeddingsInput$Outbound,
128
+ z.ZodTypeDef,
129
+ PostV2ProxyEmbeddingsInput
130
+ > = z.union([z.string(), z.array(z.string())]);
131
+
132
+ /**
133
+ * @internal
134
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
135
+ */
136
+ export namespace PostV2ProxyEmbeddingsInput$ {
137
+ /** @deprecated use `PostV2ProxyEmbeddingsInput$inboundSchema` instead. */
138
+ export const inboundSchema = PostV2ProxyEmbeddingsInput$inboundSchema;
139
+ /** @deprecated use `PostV2ProxyEmbeddingsInput$outboundSchema` instead. */
140
+ export const outboundSchema = PostV2ProxyEmbeddingsInput$outboundSchema;
141
+ /** @deprecated use `PostV2ProxyEmbeddingsInput$Outbound` instead. */
142
+ export type Outbound = PostV2ProxyEmbeddingsInput$Outbound;
143
+ }
144
+
145
+ export function postV2ProxyEmbeddingsInputToJSON(
146
+ postV2ProxyEmbeddingsInput: PostV2ProxyEmbeddingsInput,
147
+ ): string {
148
+ return JSON.stringify(
149
+ PostV2ProxyEmbeddingsInput$outboundSchema.parse(postV2ProxyEmbeddingsInput),
150
+ );
151
+ }
152
+
153
+ export function postV2ProxyEmbeddingsInputFromJSON(
154
+ jsonString: string,
155
+ ): SafeParseResult<PostV2ProxyEmbeddingsInput, SDKValidationError> {
156
+ return safeParse(
157
+ jsonString,
158
+ (x) => PostV2ProxyEmbeddingsInput$inboundSchema.parse(JSON.parse(x)),
159
+ `Failed to parse 'PostV2ProxyEmbeddingsInput' from JSON`,
160
+ );
161
+ }
162
+
163
+ /** @internal */
164
+ export const PostV2ProxyEmbeddingsEncodingFormat$inboundSchema: z.ZodNativeEnum<
165
+ typeof PostV2ProxyEmbeddingsEncodingFormat
166
+ > = z.nativeEnum(PostV2ProxyEmbeddingsEncodingFormat);
167
+
168
+ /** @internal */
169
+ export const PostV2ProxyEmbeddingsEncodingFormat$outboundSchema:
170
+ z.ZodNativeEnum<typeof PostV2ProxyEmbeddingsEncodingFormat> =
171
+ PostV2ProxyEmbeddingsEncodingFormat$inboundSchema;
172
+
173
+ /**
174
+ * @internal
175
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
176
+ */
177
+ export namespace PostV2ProxyEmbeddingsEncodingFormat$ {
178
+ /** @deprecated use `PostV2ProxyEmbeddingsEncodingFormat$inboundSchema` instead. */
179
+ export const inboundSchema =
180
+ PostV2ProxyEmbeddingsEncodingFormat$inboundSchema;
181
+ /** @deprecated use `PostV2ProxyEmbeddingsEncodingFormat$outboundSchema` instead. */
182
+ export const outboundSchema =
183
+ PostV2ProxyEmbeddingsEncodingFormat$outboundSchema;
184
+ }
185
+
186
+ /** @internal */
187
+ export const PostV2ProxyEmbeddingsRequestBody$inboundSchema: z.ZodType<
188
+ PostV2ProxyEmbeddingsRequestBody,
189
+ z.ZodTypeDef,
190
+ unknown
191
+ > = z.object({
192
+ input: z.union([z.string(), z.array(z.string())]),
193
+ model: z.string(),
194
+ encoding_format: PostV2ProxyEmbeddingsEncodingFormat$inboundSchema.default(
195
+ "float",
196
+ ),
197
+ dimensions: z.number().optional(),
198
+ user: z.string().optional(),
199
+ }).transform((v) => {
200
+ return remap$(v, {
201
+ "encoding_format": "encodingFormat",
202
+ });
203
+ });
204
+
205
+ /** @internal */
206
+ export type PostV2ProxyEmbeddingsRequestBody$Outbound = {
207
+ input: string | Array<string>;
208
+ model: string;
209
+ encoding_format: string;
210
+ dimensions?: number | undefined;
211
+ user?: string | undefined;
212
+ };
213
+
214
+ /** @internal */
215
+ export const PostV2ProxyEmbeddingsRequestBody$outboundSchema: z.ZodType<
216
+ PostV2ProxyEmbeddingsRequestBody$Outbound,
217
+ z.ZodTypeDef,
218
+ PostV2ProxyEmbeddingsRequestBody
219
+ > = z.object({
220
+ input: z.union([z.string(), z.array(z.string())]),
221
+ model: z.string(),
222
+ encodingFormat: PostV2ProxyEmbeddingsEncodingFormat$outboundSchema.default(
223
+ "float",
224
+ ),
225
+ dimensions: z.number().optional(),
226
+ user: z.string().optional(),
227
+ }).transform((v) => {
228
+ return remap$(v, {
229
+ encodingFormat: "encoding_format",
230
+ });
231
+ });
232
+
233
+ /**
234
+ * @internal
235
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
236
+ */
237
+ export namespace PostV2ProxyEmbeddingsRequestBody$ {
238
+ /** @deprecated use `PostV2ProxyEmbeddingsRequestBody$inboundSchema` instead. */
239
+ export const inboundSchema = PostV2ProxyEmbeddingsRequestBody$inboundSchema;
240
+ /** @deprecated use `PostV2ProxyEmbeddingsRequestBody$outboundSchema` instead. */
241
+ export const outboundSchema = PostV2ProxyEmbeddingsRequestBody$outboundSchema;
242
+ /** @deprecated use `PostV2ProxyEmbeddingsRequestBody$Outbound` instead. */
243
+ export type Outbound = PostV2ProxyEmbeddingsRequestBody$Outbound;
244
+ }
245
+
246
+ export function postV2ProxyEmbeddingsRequestBodyToJSON(
247
+ postV2ProxyEmbeddingsRequestBody: PostV2ProxyEmbeddingsRequestBody,
248
+ ): string {
249
+ return JSON.stringify(
250
+ PostV2ProxyEmbeddingsRequestBody$outboundSchema.parse(
251
+ postV2ProxyEmbeddingsRequestBody,
252
+ ),
253
+ );
254
+ }
255
+
256
+ export function postV2ProxyEmbeddingsRequestBodyFromJSON(
257
+ jsonString: string,
258
+ ): SafeParseResult<PostV2ProxyEmbeddingsRequestBody, SDKValidationError> {
259
+ return safeParse(
260
+ jsonString,
261
+ (x) => PostV2ProxyEmbeddingsRequestBody$inboundSchema.parse(JSON.parse(x)),
262
+ `Failed to parse 'PostV2ProxyEmbeddingsRequestBody' from JSON`,
263
+ );
264
+ }
265
+
266
+ /** @internal */
267
+ export const PostV2ProxyEmbeddingsObject$inboundSchema: z.ZodNativeEnum<
268
+ typeof PostV2ProxyEmbeddingsObject
269
+ > = z.nativeEnum(PostV2ProxyEmbeddingsObject);
270
+
271
+ /** @internal */
272
+ export const PostV2ProxyEmbeddingsObject$outboundSchema: z.ZodNativeEnum<
273
+ typeof PostV2ProxyEmbeddingsObject
274
+ > = PostV2ProxyEmbeddingsObject$inboundSchema;
275
+
276
+ /**
277
+ * @internal
278
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
279
+ */
280
+ export namespace PostV2ProxyEmbeddingsObject$ {
281
+ /** @deprecated use `PostV2ProxyEmbeddingsObject$inboundSchema` instead. */
282
+ export const inboundSchema = PostV2ProxyEmbeddingsObject$inboundSchema;
283
+ /** @deprecated use `PostV2ProxyEmbeddingsObject$outboundSchema` instead. */
284
+ export const outboundSchema = PostV2ProxyEmbeddingsObject$outboundSchema;
285
+ }
286
+
287
+ /** @internal */
288
+ export const PostV2ProxyEmbeddingsProxyObject$inboundSchema: z.ZodNativeEnum<
289
+ typeof PostV2ProxyEmbeddingsProxyObject
290
+ > = z.nativeEnum(PostV2ProxyEmbeddingsProxyObject);
291
+
292
+ /** @internal */
293
+ export const PostV2ProxyEmbeddingsProxyObject$outboundSchema: z.ZodNativeEnum<
294
+ typeof PostV2ProxyEmbeddingsProxyObject
295
+ > = PostV2ProxyEmbeddingsProxyObject$inboundSchema;
296
+
297
+ /**
298
+ * @internal
299
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
300
+ */
301
+ export namespace PostV2ProxyEmbeddingsProxyObject$ {
302
+ /** @deprecated use `PostV2ProxyEmbeddingsProxyObject$inboundSchema` instead. */
303
+ export const inboundSchema = PostV2ProxyEmbeddingsProxyObject$inboundSchema;
304
+ /** @deprecated use `PostV2ProxyEmbeddingsProxyObject$outboundSchema` instead. */
305
+ export const outboundSchema = PostV2ProxyEmbeddingsProxyObject$outboundSchema;
306
+ }
307
+
308
+ /** @internal */
309
+ export const Embedding$inboundSchema: z.ZodType<
310
+ Embedding,
311
+ z.ZodTypeDef,
312
+ unknown
313
+ > = z.union([z.array(z.number()), z.string()]);
314
+
315
+ /** @internal */
316
+ export type Embedding$Outbound = Array<number> | string;
317
+
318
+ /** @internal */
319
+ export const Embedding$outboundSchema: z.ZodType<
320
+ Embedding$Outbound,
321
+ z.ZodTypeDef,
322
+ Embedding
323
+ > = z.union([z.array(z.number()), z.string()]);
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 Embedding$ {
330
+ /** @deprecated use `Embedding$inboundSchema` instead. */
331
+ export const inboundSchema = Embedding$inboundSchema;
332
+ /** @deprecated use `Embedding$outboundSchema` instead. */
333
+ export const outboundSchema = Embedding$outboundSchema;
334
+ /** @deprecated use `Embedding$Outbound` instead. */
335
+ export type Outbound = Embedding$Outbound;
336
+ }
337
+
338
+ export function embeddingToJSON(embedding: Embedding): string {
339
+ return JSON.stringify(Embedding$outboundSchema.parse(embedding));
340
+ }
341
+
342
+ export function embeddingFromJSON(
343
+ jsonString: string,
344
+ ): SafeParseResult<Embedding, SDKValidationError> {
345
+ return safeParse(
346
+ jsonString,
347
+ (x) => Embedding$inboundSchema.parse(JSON.parse(x)),
348
+ `Failed to parse 'Embedding' from JSON`,
349
+ );
350
+ }
351
+
352
+ /** @internal */
353
+ export const PostV2ProxyEmbeddingsData$inboundSchema: z.ZodType<
354
+ PostV2ProxyEmbeddingsData,
355
+ z.ZodTypeDef,
356
+ unknown
357
+ > = z.object({
358
+ object: PostV2ProxyEmbeddingsProxyObject$inboundSchema,
359
+ embedding: z.union([z.array(z.number()), z.string()]),
360
+ index: z.number(),
361
+ });
362
+
363
+ /** @internal */
364
+ export type PostV2ProxyEmbeddingsData$Outbound = {
365
+ object: string;
366
+ embedding: Array<number> | string;
367
+ index: number;
368
+ };
369
+
370
+ /** @internal */
371
+ export const PostV2ProxyEmbeddingsData$outboundSchema: z.ZodType<
372
+ PostV2ProxyEmbeddingsData$Outbound,
373
+ z.ZodTypeDef,
374
+ PostV2ProxyEmbeddingsData
375
+ > = z.object({
376
+ object: PostV2ProxyEmbeddingsProxyObject$outboundSchema,
377
+ embedding: z.union([z.array(z.number()), z.string()]),
378
+ index: z.number(),
379
+ });
380
+
381
+ /**
382
+ * @internal
383
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
384
+ */
385
+ export namespace PostV2ProxyEmbeddingsData$ {
386
+ /** @deprecated use `PostV2ProxyEmbeddingsData$inboundSchema` instead. */
387
+ export const inboundSchema = PostV2ProxyEmbeddingsData$inboundSchema;
388
+ /** @deprecated use `PostV2ProxyEmbeddingsData$outboundSchema` instead. */
389
+ export const outboundSchema = PostV2ProxyEmbeddingsData$outboundSchema;
390
+ /** @deprecated use `PostV2ProxyEmbeddingsData$Outbound` instead. */
391
+ export type Outbound = PostV2ProxyEmbeddingsData$Outbound;
392
+ }
393
+
394
+ export function postV2ProxyEmbeddingsDataToJSON(
395
+ postV2ProxyEmbeddingsData: PostV2ProxyEmbeddingsData,
396
+ ): string {
397
+ return JSON.stringify(
398
+ PostV2ProxyEmbeddingsData$outboundSchema.parse(postV2ProxyEmbeddingsData),
399
+ );
400
+ }
401
+
402
+ export function postV2ProxyEmbeddingsDataFromJSON(
403
+ jsonString: string,
404
+ ): SafeParseResult<PostV2ProxyEmbeddingsData, SDKValidationError> {
405
+ return safeParse(
406
+ jsonString,
407
+ (x) => PostV2ProxyEmbeddingsData$inboundSchema.parse(JSON.parse(x)),
408
+ `Failed to parse 'PostV2ProxyEmbeddingsData' from JSON`,
409
+ );
410
+ }
411
+
412
+ /** @internal */
413
+ export const PostV2ProxyEmbeddingsUsage$inboundSchema: z.ZodType<
414
+ PostV2ProxyEmbeddingsUsage,
415
+ z.ZodTypeDef,
416
+ unknown
417
+ > = z.object({
418
+ prompt_tokens: z.number(),
419
+ total_tokens: z.number(),
420
+ }).transform((v) => {
421
+ return remap$(v, {
422
+ "prompt_tokens": "promptTokens",
423
+ "total_tokens": "totalTokens",
424
+ });
425
+ });
426
+
427
+ /** @internal */
428
+ export type PostV2ProxyEmbeddingsUsage$Outbound = {
429
+ prompt_tokens: number;
430
+ total_tokens: number;
431
+ };
432
+
433
+ /** @internal */
434
+ export const PostV2ProxyEmbeddingsUsage$outboundSchema: z.ZodType<
435
+ PostV2ProxyEmbeddingsUsage$Outbound,
436
+ z.ZodTypeDef,
437
+ PostV2ProxyEmbeddingsUsage
438
+ > = z.object({
439
+ promptTokens: z.number(),
440
+ totalTokens: z.number(),
441
+ }).transform((v) => {
442
+ return remap$(v, {
443
+ promptTokens: "prompt_tokens",
444
+ totalTokens: "total_tokens",
445
+ });
446
+ });
447
+
448
+ /**
449
+ * @internal
450
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
451
+ */
452
+ export namespace PostV2ProxyEmbeddingsUsage$ {
453
+ /** @deprecated use `PostV2ProxyEmbeddingsUsage$inboundSchema` instead. */
454
+ export const inboundSchema = PostV2ProxyEmbeddingsUsage$inboundSchema;
455
+ /** @deprecated use `PostV2ProxyEmbeddingsUsage$outboundSchema` instead. */
456
+ export const outboundSchema = PostV2ProxyEmbeddingsUsage$outboundSchema;
457
+ /** @deprecated use `PostV2ProxyEmbeddingsUsage$Outbound` instead. */
458
+ export type Outbound = PostV2ProxyEmbeddingsUsage$Outbound;
459
+ }
460
+
461
+ export function postV2ProxyEmbeddingsUsageToJSON(
462
+ postV2ProxyEmbeddingsUsage: PostV2ProxyEmbeddingsUsage,
463
+ ): string {
464
+ return JSON.stringify(
465
+ PostV2ProxyEmbeddingsUsage$outboundSchema.parse(postV2ProxyEmbeddingsUsage),
466
+ );
467
+ }
468
+
469
+ export function postV2ProxyEmbeddingsUsageFromJSON(
470
+ jsonString: string,
471
+ ): SafeParseResult<PostV2ProxyEmbeddingsUsage, SDKValidationError> {
472
+ return safeParse(
473
+ jsonString,
474
+ (x) => PostV2ProxyEmbeddingsUsage$inboundSchema.parse(JSON.parse(x)),
475
+ `Failed to parse 'PostV2ProxyEmbeddingsUsage' from JSON`,
476
+ );
477
+ }
478
+
479
+ /** @internal */
480
+ export const PostV2ProxyEmbeddingsResponseBody$inboundSchema: z.ZodType<
481
+ PostV2ProxyEmbeddingsResponseBody,
482
+ z.ZodTypeDef,
483
+ unknown
484
+ > = z.object({
485
+ object: PostV2ProxyEmbeddingsObject$inboundSchema,
486
+ data: z.array(z.lazy(() => PostV2ProxyEmbeddingsData$inboundSchema)),
487
+ model: z.string(),
488
+ usage: z.lazy(() => PostV2ProxyEmbeddingsUsage$inboundSchema).optional(),
489
+ });
490
+
491
+ /** @internal */
492
+ export type PostV2ProxyEmbeddingsResponseBody$Outbound = {
493
+ object: string;
494
+ data: Array<PostV2ProxyEmbeddingsData$Outbound>;
495
+ model: string;
496
+ usage?: PostV2ProxyEmbeddingsUsage$Outbound | undefined;
497
+ };
498
+
499
+ /** @internal */
500
+ export const PostV2ProxyEmbeddingsResponseBody$outboundSchema: z.ZodType<
501
+ PostV2ProxyEmbeddingsResponseBody$Outbound,
502
+ z.ZodTypeDef,
503
+ PostV2ProxyEmbeddingsResponseBody
504
+ > = z.object({
505
+ object: PostV2ProxyEmbeddingsObject$outboundSchema,
506
+ data: z.array(z.lazy(() => PostV2ProxyEmbeddingsData$outboundSchema)),
507
+ model: z.string(),
508
+ usage: z.lazy(() => PostV2ProxyEmbeddingsUsage$outboundSchema).optional(),
509
+ });
510
+
511
+ /**
512
+ * @internal
513
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
514
+ */
515
+ export namespace PostV2ProxyEmbeddingsResponseBody$ {
516
+ /** @deprecated use `PostV2ProxyEmbeddingsResponseBody$inboundSchema` instead. */
517
+ export const inboundSchema = PostV2ProxyEmbeddingsResponseBody$inboundSchema;
518
+ /** @deprecated use `PostV2ProxyEmbeddingsResponseBody$outboundSchema` instead. */
519
+ export const outboundSchema =
520
+ PostV2ProxyEmbeddingsResponseBody$outboundSchema;
521
+ /** @deprecated use `PostV2ProxyEmbeddingsResponseBody$Outbound` instead. */
522
+ export type Outbound = PostV2ProxyEmbeddingsResponseBody$Outbound;
523
+ }
524
+
525
+ export function postV2ProxyEmbeddingsResponseBodyToJSON(
526
+ postV2ProxyEmbeddingsResponseBody: PostV2ProxyEmbeddingsResponseBody,
527
+ ): string {
528
+ return JSON.stringify(
529
+ PostV2ProxyEmbeddingsResponseBody$outboundSchema.parse(
530
+ postV2ProxyEmbeddingsResponseBody,
531
+ ),
532
+ );
533
+ }
534
+
535
+ export function postV2ProxyEmbeddingsResponseBodyFromJSON(
536
+ jsonString: string,
537
+ ): SafeParseResult<PostV2ProxyEmbeddingsResponseBody, SDKValidationError> {
538
+ return safeParse(
539
+ jsonString,
540
+ (x) => PostV2ProxyEmbeddingsResponseBody$inboundSchema.parse(JSON.parse(x)),
541
+ `Failed to parse 'PostV2ProxyEmbeddingsResponseBody' from JSON`,
542
+ );
543
+ }