@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,526 @@
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
+ export type PostV2ProxyRerankDocuments = string | { [k: string]: string };
13
+
14
+ /**
15
+ * input
16
+ */
17
+ export type PostV2ProxyRerankRequestBody = {
18
+ /**
19
+ * The search query
20
+ */
21
+ query: string;
22
+ /**
23
+ * A list of document objects or strings to rerank.
24
+ */
25
+ documents: Array<string | { [k: string]: string }>;
26
+ /**
27
+ * The identifier of the model to use
28
+ */
29
+ model: string;
30
+ /**
31
+ * The number of most relevant documents or indices to return, defaults to the length of the documents
32
+ */
33
+ topN?: number | undefined;
34
+ /**
35
+ * The filename of the document to rerank
36
+ */
37
+ filename?: string | null | undefined;
38
+ };
39
+
40
+ export const PostV2ProxyRerankObject = {
41
+ List: "list",
42
+ } as const;
43
+ export type PostV2ProxyRerankObject = ClosedEnum<
44
+ typeof PostV2ProxyRerankObject
45
+ >;
46
+
47
+ /**
48
+ * The object type, which is always `rerank`.
49
+ */
50
+ export const PostV2ProxyRerankProxyObject = {
51
+ Rerank: "rerank",
52
+ } as const;
53
+ /**
54
+ * The object type, which is always `rerank`.
55
+ */
56
+ export type PostV2ProxyRerankProxyObject = ClosedEnum<
57
+ typeof PostV2ProxyRerankProxyObject
58
+ >;
59
+
60
+ /**
61
+ * If return_documents is set as false this will return none, if true it will return the documents passed in
62
+ */
63
+ export type Document = {
64
+ /**
65
+ * The text of the document to rerank
66
+ */
67
+ text: string;
68
+ };
69
+
70
+ export type PostV2ProxyRerankResults = {
71
+ /**
72
+ * The object type, which is always `rerank`.
73
+ */
74
+ object: PostV2ProxyRerankProxyObject;
75
+ /**
76
+ * Corresponds to the index in the original list of documents to which the ranked document belongs.
77
+ */
78
+ index: number;
79
+ /**
80
+ * Relevance scores are normalized to be in the range [0, 1]. Scores close to 1 indicate a high relevance to the query, and scores closer to 0 indicate low relevance.
81
+ */
82
+ relevanceScore: number;
83
+ /**
84
+ * If return_documents is set as false this will return none, if true it will return the documents passed in
85
+ */
86
+ document?: Document | undefined;
87
+ };
88
+
89
+ export type PostV2ProxyRerankUsage = {
90
+ /**
91
+ * The total number of tokens used in the rerank
92
+ */
93
+ totalTokens: number;
94
+ };
95
+
96
+ /**
97
+ * Returns the reranked documents.
98
+ */
99
+ export type PostV2ProxyRerankResponseBody = {
100
+ /**
101
+ * A unique identifier for the rerank.
102
+ */
103
+ id?: string | undefined;
104
+ object: PostV2ProxyRerankObject;
105
+ /**
106
+ * An ordered list of ranked documents
107
+ */
108
+ results: Array<PostV2ProxyRerankResults>;
109
+ usage?: PostV2ProxyRerankUsage | undefined;
110
+ };
111
+
112
+ /** @internal */
113
+ export const PostV2ProxyRerankDocuments$inboundSchema: z.ZodType<
114
+ PostV2ProxyRerankDocuments,
115
+ z.ZodTypeDef,
116
+ unknown
117
+ > = z.union([z.string(), z.record(z.string())]);
118
+
119
+ /** @internal */
120
+ export type PostV2ProxyRerankDocuments$Outbound = string | {
121
+ [k: string]: string;
122
+ };
123
+
124
+ /** @internal */
125
+ export const PostV2ProxyRerankDocuments$outboundSchema: z.ZodType<
126
+ PostV2ProxyRerankDocuments$Outbound,
127
+ z.ZodTypeDef,
128
+ PostV2ProxyRerankDocuments
129
+ > = z.union([z.string(), z.record(z.string())]);
130
+
131
+ /**
132
+ * @internal
133
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
134
+ */
135
+ export namespace PostV2ProxyRerankDocuments$ {
136
+ /** @deprecated use `PostV2ProxyRerankDocuments$inboundSchema` instead. */
137
+ export const inboundSchema = PostV2ProxyRerankDocuments$inboundSchema;
138
+ /** @deprecated use `PostV2ProxyRerankDocuments$outboundSchema` instead. */
139
+ export const outboundSchema = PostV2ProxyRerankDocuments$outboundSchema;
140
+ /** @deprecated use `PostV2ProxyRerankDocuments$Outbound` instead. */
141
+ export type Outbound = PostV2ProxyRerankDocuments$Outbound;
142
+ }
143
+
144
+ export function postV2ProxyRerankDocumentsToJSON(
145
+ postV2ProxyRerankDocuments: PostV2ProxyRerankDocuments,
146
+ ): string {
147
+ return JSON.stringify(
148
+ PostV2ProxyRerankDocuments$outboundSchema.parse(postV2ProxyRerankDocuments),
149
+ );
150
+ }
151
+
152
+ export function postV2ProxyRerankDocumentsFromJSON(
153
+ jsonString: string,
154
+ ): SafeParseResult<PostV2ProxyRerankDocuments, SDKValidationError> {
155
+ return safeParse(
156
+ jsonString,
157
+ (x) => PostV2ProxyRerankDocuments$inboundSchema.parse(JSON.parse(x)),
158
+ `Failed to parse 'PostV2ProxyRerankDocuments' from JSON`,
159
+ );
160
+ }
161
+
162
+ /** @internal */
163
+ export const PostV2ProxyRerankRequestBody$inboundSchema: z.ZodType<
164
+ PostV2ProxyRerankRequestBody,
165
+ z.ZodTypeDef,
166
+ unknown
167
+ > = z.object({
168
+ query: z.string(),
169
+ documents: z.array(z.union([z.string(), z.record(z.string())])),
170
+ model: z.string(),
171
+ top_n: z.number().optional(),
172
+ filename: z.nullable(z.string()).optional(),
173
+ }).transform((v) => {
174
+ return remap$(v, {
175
+ "top_n": "topN",
176
+ });
177
+ });
178
+
179
+ /** @internal */
180
+ export type PostV2ProxyRerankRequestBody$Outbound = {
181
+ query: string;
182
+ documents: Array<string | { [k: string]: string }>;
183
+ model: string;
184
+ top_n?: number | undefined;
185
+ filename?: string | null | undefined;
186
+ };
187
+
188
+ /** @internal */
189
+ export const PostV2ProxyRerankRequestBody$outboundSchema: z.ZodType<
190
+ PostV2ProxyRerankRequestBody$Outbound,
191
+ z.ZodTypeDef,
192
+ PostV2ProxyRerankRequestBody
193
+ > = z.object({
194
+ query: z.string(),
195
+ documents: z.array(z.union([z.string(), z.record(z.string())])),
196
+ model: z.string(),
197
+ topN: z.number().optional(),
198
+ filename: z.nullable(z.string()).optional(),
199
+ }).transform((v) => {
200
+ return remap$(v, {
201
+ topN: "top_n",
202
+ });
203
+ });
204
+
205
+ /**
206
+ * @internal
207
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
208
+ */
209
+ export namespace PostV2ProxyRerankRequestBody$ {
210
+ /** @deprecated use `PostV2ProxyRerankRequestBody$inboundSchema` instead. */
211
+ export const inboundSchema = PostV2ProxyRerankRequestBody$inboundSchema;
212
+ /** @deprecated use `PostV2ProxyRerankRequestBody$outboundSchema` instead. */
213
+ export const outboundSchema = PostV2ProxyRerankRequestBody$outboundSchema;
214
+ /** @deprecated use `PostV2ProxyRerankRequestBody$Outbound` instead. */
215
+ export type Outbound = PostV2ProxyRerankRequestBody$Outbound;
216
+ }
217
+
218
+ export function postV2ProxyRerankRequestBodyToJSON(
219
+ postV2ProxyRerankRequestBody: PostV2ProxyRerankRequestBody,
220
+ ): string {
221
+ return JSON.stringify(
222
+ PostV2ProxyRerankRequestBody$outboundSchema.parse(
223
+ postV2ProxyRerankRequestBody,
224
+ ),
225
+ );
226
+ }
227
+
228
+ export function postV2ProxyRerankRequestBodyFromJSON(
229
+ jsonString: string,
230
+ ): SafeParseResult<PostV2ProxyRerankRequestBody, SDKValidationError> {
231
+ return safeParse(
232
+ jsonString,
233
+ (x) => PostV2ProxyRerankRequestBody$inboundSchema.parse(JSON.parse(x)),
234
+ `Failed to parse 'PostV2ProxyRerankRequestBody' from JSON`,
235
+ );
236
+ }
237
+
238
+ /** @internal */
239
+ export const PostV2ProxyRerankObject$inboundSchema: z.ZodNativeEnum<
240
+ typeof PostV2ProxyRerankObject
241
+ > = z.nativeEnum(PostV2ProxyRerankObject);
242
+
243
+ /** @internal */
244
+ export const PostV2ProxyRerankObject$outboundSchema: z.ZodNativeEnum<
245
+ typeof PostV2ProxyRerankObject
246
+ > = PostV2ProxyRerankObject$inboundSchema;
247
+
248
+ /**
249
+ * @internal
250
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
251
+ */
252
+ export namespace PostV2ProxyRerankObject$ {
253
+ /** @deprecated use `PostV2ProxyRerankObject$inboundSchema` instead. */
254
+ export const inboundSchema = PostV2ProxyRerankObject$inboundSchema;
255
+ /** @deprecated use `PostV2ProxyRerankObject$outboundSchema` instead. */
256
+ export const outboundSchema = PostV2ProxyRerankObject$outboundSchema;
257
+ }
258
+
259
+ /** @internal */
260
+ export const PostV2ProxyRerankProxyObject$inboundSchema: z.ZodNativeEnum<
261
+ typeof PostV2ProxyRerankProxyObject
262
+ > = z.nativeEnum(PostV2ProxyRerankProxyObject);
263
+
264
+ /** @internal */
265
+ export const PostV2ProxyRerankProxyObject$outboundSchema: z.ZodNativeEnum<
266
+ typeof PostV2ProxyRerankProxyObject
267
+ > = PostV2ProxyRerankProxyObject$inboundSchema;
268
+
269
+ /**
270
+ * @internal
271
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
272
+ */
273
+ export namespace PostV2ProxyRerankProxyObject$ {
274
+ /** @deprecated use `PostV2ProxyRerankProxyObject$inboundSchema` instead. */
275
+ export const inboundSchema = PostV2ProxyRerankProxyObject$inboundSchema;
276
+ /** @deprecated use `PostV2ProxyRerankProxyObject$outboundSchema` instead. */
277
+ export const outboundSchema = PostV2ProxyRerankProxyObject$outboundSchema;
278
+ }
279
+
280
+ /** @internal */
281
+ export const Document$inboundSchema: z.ZodType<
282
+ Document,
283
+ z.ZodTypeDef,
284
+ unknown
285
+ > = z.object({
286
+ text: z.string(),
287
+ });
288
+
289
+ /** @internal */
290
+ export type Document$Outbound = {
291
+ text: string;
292
+ };
293
+
294
+ /** @internal */
295
+ export const Document$outboundSchema: z.ZodType<
296
+ Document$Outbound,
297
+ z.ZodTypeDef,
298
+ Document
299
+ > = z.object({
300
+ text: z.string(),
301
+ });
302
+
303
+ /**
304
+ * @internal
305
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
306
+ */
307
+ export namespace Document$ {
308
+ /** @deprecated use `Document$inboundSchema` instead. */
309
+ export const inboundSchema = Document$inboundSchema;
310
+ /** @deprecated use `Document$outboundSchema` instead. */
311
+ export const outboundSchema = Document$outboundSchema;
312
+ /** @deprecated use `Document$Outbound` instead. */
313
+ export type Outbound = Document$Outbound;
314
+ }
315
+
316
+ export function documentToJSON(document: Document): string {
317
+ return JSON.stringify(Document$outboundSchema.parse(document));
318
+ }
319
+
320
+ export function documentFromJSON(
321
+ jsonString: string,
322
+ ): SafeParseResult<Document, SDKValidationError> {
323
+ return safeParse(
324
+ jsonString,
325
+ (x) => Document$inboundSchema.parse(JSON.parse(x)),
326
+ `Failed to parse 'Document' from JSON`,
327
+ );
328
+ }
329
+
330
+ /** @internal */
331
+ export const PostV2ProxyRerankResults$inboundSchema: z.ZodType<
332
+ PostV2ProxyRerankResults,
333
+ z.ZodTypeDef,
334
+ unknown
335
+ > = z.object({
336
+ object: PostV2ProxyRerankProxyObject$inboundSchema,
337
+ index: z.number(),
338
+ relevance_score: z.number(),
339
+ document: z.lazy(() => Document$inboundSchema).optional(),
340
+ }).transform((v) => {
341
+ return remap$(v, {
342
+ "relevance_score": "relevanceScore",
343
+ });
344
+ });
345
+
346
+ /** @internal */
347
+ export type PostV2ProxyRerankResults$Outbound = {
348
+ object: string;
349
+ index: number;
350
+ relevance_score: number;
351
+ document?: Document$Outbound | undefined;
352
+ };
353
+
354
+ /** @internal */
355
+ export const PostV2ProxyRerankResults$outboundSchema: z.ZodType<
356
+ PostV2ProxyRerankResults$Outbound,
357
+ z.ZodTypeDef,
358
+ PostV2ProxyRerankResults
359
+ > = z.object({
360
+ object: PostV2ProxyRerankProxyObject$outboundSchema,
361
+ index: z.number(),
362
+ relevanceScore: z.number(),
363
+ document: z.lazy(() => Document$outboundSchema).optional(),
364
+ }).transform((v) => {
365
+ return remap$(v, {
366
+ relevanceScore: "relevance_score",
367
+ });
368
+ });
369
+
370
+ /**
371
+ * @internal
372
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
373
+ */
374
+ export namespace PostV2ProxyRerankResults$ {
375
+ /** @deprecated use `PostV2ProxyRerankResults$inboundSchema` instead. */
376
+ export const inboundSchema = PostV2ProxyRerankResults$inboundSchema;
377
+ /** @deprecated use `PostV2ProxyRerankResults$outboundSchema` instead. */
378
+ export const outboundSchema = PostV2ProxyRerankResults$outboundSchema;
379
+ /** @deprecated use `PostV2ProxyRerankResults$Outbound` instead. */
380
+ export type Outbound = PostV2ProxyRerankResults$Outbound;
381
+ }
382
+
383
+ export function postV2ProxyRerankResultsToJSON(
384
+ postV2ProxyRerankResults: PostV2ProxyRerankResults,
385
+ ): string {
386
+ return JSON.stringify(
387
+ PostV2ProxyRerankResults$outboundSchema.parse(postV2ProxyRerankResults),
388
+ );
389
+ }
390
+
391
+ export function postV2ProxyRerankResultsFromJSON(
392
+ jsonString: string,
393
+ ): SafeParseResult<PostV2ProxyRerankResults, SDKValidationError> {
394
+ return safeParse(
395
+ jsonString,
396
+ (x) => PostV2ProxyRerankResults$inboundSchema.parse(JSON.parse(x)),
397
+ `Failed to parse 'PostV2ProxyRerankResults' from JSON`,
398
+ );
399
+ }
400
+
401
+ /** @internal */
402
+ export const PostV2ProxyRerankUsage$inboundSchema: z.ZodType<
403
+ PostV2ProxyRerankUsage,
404
+ z.ZodTypeDef,
405
+ unknown
406
+ > = z.object({
407
+ total_tokens: z.number(),
408
+ }).transform((v) => {
409
+ return remap$(v, {
410
+ "total_tokens": "totalTokens",
411
+ });
412
+ });
413
+
414
+ /** @internal */
415
+ export type PostV2ProxyRerankUsage$Outbound = {
416
+ total_tokens: number;
417
+ };
418
+
419
+ /** @internal */
420
+ export const PostV2ProxyRerankUsage$outboundSchema: z.ZodType<
421
+ PostV2ProxyRerankUsage$Outbound,
422
+ z.ZodTypeDef,
423
+ PostV2ProxyRerankUsage
424
+ > = z.object({
425
+ totalTokens: z.number(),
426
+ }).transform((v) => {
427
+ return remap$(v, {
428
+ totalTokens: "total_tokens",
429
+ });
430
+ });
431
+
432
+ /**
433
+ * @internal
434
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
435
+ */
436
+ export namespace PostV2ProxyRerankUsage$ {
437
+ /** @deprecated use `PostV2ProxyRerankUsage$inboundSchema` instead. */
438
+ export const inboundSchema = PostV2ProxyRerankUsage$inboundSchema;
439
+ /** @deprecated use `PostV2ProxyRerankUsage$outboundSchema` instead. */
440
+ export const outboundSchema = PostV2ProxyRerankUsage$outboundSchema;
441
+ /** @deprecated use `PostV2ProxyRerankUsage$Outbound` instead. */
442
+ export type Outbound = PostV2ProxyRerankUsage$Outbound;
443
+ }
444
+
445
+ export function postV2ProxyRerankUsageToJSON(
446
+ postV2ProxyRerankUsage: PostV2ProxyRerankUsage,
447
+ ): string {
448
+ return JSON.stringify(
449
+ PostV2ProxyRerankUsage$outboundSchema.parse(postV2ProxyRerankUsage),
450
+ );
451
+ }
452
+
453
+ export function postV2ProxyRerankUsageFromJSON(
454
+ jsonString: string,
455
+ ): SafeParseResult<PostV2ProxyRerankUsage, SDKValidationError> {
456
+ return safeParse(
457
+ jsonString,
458
+ (x) => PostV2ProxyRerankUsage$inboundSchema.parse(JSON.parse(x)),
459
+ `Failed to parse 'PostV2ProxyRerankUsage' from JSON`,
460
+ );
461
+ }
462
+
463
+ /** @internal */
464
+ export const PostV2ProxyRerankResponseBody$inboundSchema: z.ZodType<
465
+ PostV2ProxyRerankResponseBody,
466
+ z.ZodTypeDef,
467
+ unknown
468
+ > = z.object({
469
+ id: z.string().optional(),
470
+ object: PostV2ProxyRerankObject$inboundSchema,
471
+ results: z.array(z.lazy(() => PostV2ProxyRerankResults$inboundSchema)),
472
+ usage: z.lazy(() => PostV2ProxyRerankUsage$inboundSchema).optional(),
473
+ });
474
+
475
+ /** @internal */
476
+ export type PostV2ProxyRerankResponseBody$Outbound = {
477
+ id?: string | undefined;
478
+ object: string;
479
+ results: Array<PostV2ProxyRerankResults$Outbound>;
480
+ usage?: PostV2ProxyRerankUsage$Outbound | undefined;
481
+ };
482
+
483
+ /** @internal */
484
+ export const PostV2ProxyRerankResponseBody$outboundSchema: z.ZodType<
485
+ PostV2ProxyRerankResponseBody$Outbound,
486
+ z.ZodTypeDef,
487
+ PostV2ProxyRerankResponseBody
488
+ > = z.object({
489
+ id: z.string().optional(),
490
+ object: PostV2ProxyRerankObject$outboundSchema,
491
+ results: z.array(z.lazy(() => PostV2ProxyRerankResults$outboundSchema)),
492
+ usage: z.lazy(() => PostV2ProxyRerankUsage$outboundSchema).optional(),
493
+ });
494
+
495
+ /**
496
+ * @internal
497
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
498
+ */
499
+ export namespace PostV2ProxyRerankResponseBody$ {
500
+ /** @deprecated use `PostV2ProxyRerankResponseBody$inboundSchema` instead. */
501
+ export const inboundSchema = PostV2ProxyRerankResponseBody$inboundSchema;
502
+ /** @deprecated use `PostV2ProxyRerankResponseBody$outboundSchema` instead. */
503
+ export const outboundSchema = PostV2ProxyRerankResponseBody$outboundSchema;
504
+ /** @deprecated use `PostV2ProxyRerankResponseBody$Outbound` instead. */
505
+ export type Outbound = PostV2ProxyRerankResponseBody$Outbound;
506
+ }
507
+
508
+ export function postV2ProxyRerankResponseBodyToJSON(
509
+ postV2ProxyRerankResponseBody: PostV2ProxyRerankResponseBody,
510
+ ): string {
511
+ return JSON.stringify(
512
+ PostV2ProxyRerankResponseBody$outboundSchema.parse(
513
+ postV2ProxyRerankResponseBody,
514
+ ),
515
+ );
516
+ }
517
+
518
+ export function postV2ProxyRerankResponseBodyFromJSON(
519
+ jsonString: string,
520
+ ): SafeParseResult<PostV2ProxyRerankResponseBody, SDKValidationError> {
521
+ return safeParse(
522
+ jsonString,
523
+ (x) => PostV2ProxyRerankResponseBody$inboundSchema.parse(JSON.parse(x)),
524
+ `Failed to parse 'PostV2ProxyRerankResponseBody' from JSON`,
525
+ );
526
+ }