@orq-ai/node 4.15.0-rc.54 → 4.15.0-rc.55

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 (192) hide show
  1. package/README.md +7 -1
  2. package/funcs/datasetsList.js +1 -0
  3. package/funcs/datasetsList.js.map +1 -1
  4. package/funcs/evalsAll.d.ts +2 -2
  5. package/funcs/evalsAll.d.ts.map +1 -1
  6. package/funcs/evalsAll.js +5 -2
  7. package/funcs/evalsAll.js.map +1 -1
  8. package/funcs/evalsCreate.d.ts +2 -1
  9. package/funcs/evalsCreate.d.ts.map +1 -1
  10. package/funcs/evalsCreate.js +19 -4
  11. package/funcs/evalsCreate.js.map +1 -1
  12. package/funcs/evalsDelete.d.ts +2 -2
  13. package/funcs/evalsDelete.d.ts.map +1 -1
  14. package/funcs/evalsDelete.js +6 -2
  15. package/funcs/evalsDelete.js.map +1 -1
  16. package/funcs/evalsGet.d.ts +2 -1
  17. package/funcs/evalsGet.d.ts.map +1 -1
  18. package/funcs/evalsGet.js +5 -1
  19. package/funcs/evalsGet.js.map +1 -1
  20. package/funcs/evalsUpdate.d.ts +2 -1
  21. package/funcs/evalsUpdate.d.ts.map +1 -1
  22. package/funcs/evalsUpdate.js +5 -1
  23. package/funcs/evalsUpdate.js.map +1 -1
  24. package/jsr.json +1 -1
  25. package/lib/config.d.ts +2 -2
  26. package/lib/config.js +2 -2
  27. package/models/components/chunkingconfiguration.d.ts +30 -30
  28. package/models/components/chunkingconfiguration.d.ts.map +1 -1
  29. package/models/components/chunkingconfiguration.js +36 -37
  30. package/models/components/chunkingconfiguration.js.map +1 -1
  31. package/models/components/evaluatorresponsefunction.d.ts +230 -0
  32. package/models/components/evaluatorresponsefunction.d.ts.map +1 -0
  33. package/models/components/evaluatorresponsefunction.js +420 -0
  34. package/models/components/evaluatorresponsefunction.js.map +1 -0
  35. package/models/components/evaluatorresponsehttp.d.ts +37 -0
  36. package/models/components/evaluatorresponsehttp.d.ts.map +1 -0
  37. package/models/components/evaluatorresponsehttp.js +77 -0
  38. package/models/components/evaluatorresponsehttp.js.map +1 -0
  39. package/models/components/evaluatorresponsejsonschema.d.ts +22 -0
  40. package/models/components/evaluatorresponsejsonschema.d.ts.map +1 -0
  41. package/models/components/{listevaluatorsresponse.js → evaluatorresponsejsonschema.js} +20 -16
  42. package/models/components/evaluatorresponsejsonschema.js.map +1 -0
  43. package/models/components/evaluatorresponsellm.d.ts +101 -0
  44. package/models/components/evaluatorresponsellm.d.ts.map +1 -0
  45. package/models/components/evaluatorresponsellm.js +181 -0
  46. package/models/components/evaluatorresponsellm.js.map +1 -0
  47. package/models/components/evaluatorresponsepython.d.ts +22 -0
  48. package/models/components/evaluatorresponsepython.d.ts.map +1 -0
  49. package/models/components/evaluatorresponsepython.js +67 -0
  50. package/models/components/evaluatorresponsepython.js.map +1 -0
  51. package/models/components/evaluatorresponseragas.d.ts +41 -0
  52. package/models/components/evaluatorresponseragas.d.ts.map +1 -0
  53. package/models/components/evaluatorresponseragas.js +86 -0
  54. package/models/components/evaluatorresponseragas.js.map +1 -0
  55. package/models/components/evaluatorresponsetypescript.d.ts +22 -0
  56. package/models/components/evaluatorresponsetypescript.d.ts.map +1 -0
  57. package/models/components/evaluatorresponsetypescript.js +67 -0
  58. package/models/components/evaluatorresponsetypescript.js.map +1 -0
  59. package/models/components/index.d.ts +7 -2
  60. package/models/components/index.d.ts.map +1 -1
  61. package/models/components/index.js +7 -2
  62. package/models/components/index.js.map +1 -1
  63. package/models/components/queryreportrequest.d.ts +5 -5
  64. package/models/components/queryreportrequest.d.ts.map +1 -1
  65. package/models/components/queryreportrequest.js +6 -6
  66. package/models/components/queryreportrequest.js.map +1 -1
  67. package/models/components/reasoningpart.js +1 -1
  68. package/models/errors/createeval.d.ts +23 -0
  69. package/models/errors/createeval.d.ts.map +1 -0
  70. package/models/errors/createeval.js +68 -0
  71. package/models/errors/createeval.js.map +1 -0
  72. package/models/errors/deleteeval.d.ts +43 -0
  73. package/models/errors/deleteeval.d.ts.map +1 -0
  74. package/models/errors/deleteeval.js +94 -0
  75. package/models/errors/deleteeval.js.map +1 -0
  76. package/models/errors/geteval.d.ts +23 -0
  77. package/models/errors/geteval.d.ts.map +1 -0
  78. package/models/errors/geteval.js +68 -0
  79. package/models/errors/geteval.js.map +1 -0
  80. package/models/errors/getevals.d.ts +23 -0
  81. package/models/errors/getevals.d.ts.map +1 -0
  82. package/models/{components/deleteevaluatorresponse.js → errors/getevals.js} +28 -8
  83. package/models/errors/getevals.js.map +1 -0
  84. package/models/errors/index.d.ts +5 -0
  85. package/models/errors/index.d.ts.map +1 -1
  86. package/models/errors/index.js +5 -0
  87. package/models/errors/index.js.map +1 -1
  88. package/models/errors/updateeval.d.ts +23 -0
  89. package/models/errors/updateeval.d.ts.map +1 -0
  90. package/models/errors/updateeval.js +68 -0
  91. package/models/errors/updateeval.js.map +1 -0
  92. package/models/operations/createdataset.js +1 -1
  93. package/models/operations/createdatasetitem.js +5 -5
  94. package/models/operations/createeval.d.ts +305 -4
  95. package/models/operations/createeval.d.ts.map +1 -1
  96. package/models/operations/createeval.js +258 -3
  97. package/models/operations/createeval.js.map +1 -1
  98. package/models/operations/createtool.d.ts +4 -4
  99. package/models/operations/createtool.d.ts.map +1 -1
  100. package/models/operations/createtool.js +9 -9
  101. package/models/operations/createtool.js.map +1 -1
  102. package/models/operations/getalltools.js +4 -4
  103. package/models/operations/geteval.d.ts +804 -2
  104. package/models/operations/geteval.d.ts.map +1 -1
  105. package/models/operations/geteval.js +1244 -2
  106. package/models/operations/geteval.js.map +1 -1
  107. package/models/operations/getevals.d.ts +41 -3
  108. package/models/operations/getevals.d.ts.map +1 -1
  109. package/models/operations/getevals.js +52 -3
  110. package/models/operations/getevals.js.map +1 -1
  111. package/models/operations/getv2humanevalsets.js +2 -2
  112. package/models/operations/getv2humanevalsetsid.js +2 -2
  113. package/models/operations/listdatasetdatapoints.js +5 -5
  114. package/models/operations/listdatasets.d.ts +5 -0
  115. package/models/operations/listdatasets.d.ts.map +1 -1
  116. package/models/operations/listdatasets.js +3 -1
  117. package/models/operations/listdatasets.js.map +1 -1
  118. package/models/operations/patchv2humanevalsetsid.js +2 -2
  119. package/models/operations/postv2feedbackevaluation.js +4 -4
  120. package/models/operations/postv2humanevalsets.js +2 -2
  121. package/models/operations/retrievedatapoint.js +5 -5
  122. package/models/operations/retrievedataset.js +1 -1
  123. package/models/operations/retrievetool.js +4 -4
  124. package/models/operations/runagent.js +1 -1
  125. package/models/operations/streamrunagent.js +1 -1
  126. package/models/operations/updatedatapoint.js +5 -5
  127. package/models/operations/updatedataset.js +1 -1
  128. package/models/operations/updateeval.d.ts +194 -6
  129. package/models/operations/updateeval.d.ts.map +1 -1
  130. package/models/operations/updateeval.js +155 -4
  131. package/models/operations/updateeval.js.map +1 -1
  132. package/models/operations/updatetool.js +4 -4
  133. package/package.json +1 -1
  134. package/sdk/evals.d.ts +3 -3
  135. package/sdk/evals.d.ts.map +1 -1
  136. package/sdk/evals.js.map +1 -1
  137. package/src/funcs/datasetsList.ts +1 -0
  138. package/src/funcs/evalsAll.ts +14 -6
  139. package/src/funcs/evalsCreate.ts +31 -5
  140. package/src/funcs/evalsDelete.ts +19 -6
  141. package/src/funcs/evalsGet.ts +10 -1
  142. package/src/funcs/evalsUpdate.ts +10 -1
  143. package/src/lib/config.ts +2 -2
  144. package/src/models/components/chunkingconfiguration.ts +150 -110
  145. package/src/models/components/evaluatorresponsefunction.ts +928 -0
  146. package/src/models/components/evaluatorresponsehttp.ts +77 -0
  147. package/src/models/components/evaluatorresponsejsonschema.ts +60 -0
  148. package/src/models/components/evaluatorresponsellm.ts +310 -0
  149. package/src/models/components/evaluatorresponsepython.ts +60 -0
  150. package/src/models/components/evaluatorresponseragas.ts +84 -0
  151. package/src/models/components/evaluatorresponsetypescript.ts +60 -0
  152. package/src/models/components/index.ts +7 -2
  153. package/src/models/components/queryreportrequest.ts +11 -10
  154. package/src/models/components/reasoningpart.ts +1 -1
  155. package/src/models/errors/createeval.ts +51 -0
  156. package/src/models/errors/deleteeval.ts +96 -0
  157. package/src/models/errors/geteval.ts +51 -0
  158. package/src/models/errors/getevals.ts +51 -0
  159. package/src/models/errors/index.ts +5 -0
  160. package/src/models/errors/updateeval.ts +51 -0
  161. package/src/models/operations/createdataset.ts +1 -1
  162. package/src/models/operations/createdatasetitem.ts +5 -5
  163. package/src/models/operations/createeval.ts +628 -6
  164. package/src/models/operations/createtool.ts +13 -11
  165. package/src/models/operations/getalltools.ts +4 -4
  166. package/src/models/operations/geteval.ts +2751 -3
  167. package/src/models/operations/getevals.ts +123 -5
  168. package/src/models/operations/getv2humanevalsets.ts +2 -2
  169. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  170. package/src/models/operations/listdatasetdatapoints.ts +5 -5
  171. package/src/models/operations/listdatasets.ts +8 -1
  172. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  173. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  174. package/src/models/operations/postv2humanevalsets.ts +2 -2
  175. package/src/models/operations/retrievedatapoint.ts +5 -5
  176. package/src/models/operations/retrievedataset.ts +1 -1
  177. package/src/models/operations/retrievetool.ts +4 -4
  178. package/src/models/operations/runagent.ts +1 -1
  179. package/src/models/operations/streamrunagent.ts +1 -1
  180. package/src/models/operations/updatedatapoint.ts +5 -5
  181. package/src/models/operations/updatedataset.ts +1 -1
  182. package/src/models/operations/updateeval.ts +393 -9
  183. package/src/models/operations/updatetool.ts +4 -4
  184. package/src/sdk/evals.ts +3 -3
  185. package/models/components/deleteevaluatorresponse.d.ts +0 -8
  186. package/models/components/deleteevaluatorresponse.d.ts.map +0 -1
  187. package/models/components/deleteevaluatorresponse.js.map +0 -1
  188. package/models/components/listevaluatorsresponse.d.ts +0 -16
  189. package/models/components/listevaluatorsresponse.d.ts.map +0 -1
  190. package/models/components/listevaluatorsresponse.js.map +0 -1
  191. package/src/models/components/deleteevaluatorresponse.ts +0 -27
  192. package/src/models/components/listevaluatorsresponse.ts +0 -59
@@ -0,0 +1,928 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type ThirtyTwo = {
12
+ type: "grammar_diversity";
13
+ };
14
+
15
+ export type ThirtyOne = {
16
+ type: "lexical_repetition";
17
+ };
18
+
19
+ export type Thirty = {
20
+ type: "sentences_count";
21
+ };
22
+
23
+ export type TwentyNine = {
24
+ type: "words_count";
25
+ };
26
+
27
+ export type TwentyEight = {
28
+ type: "gse_english_level";
29
+ };
30
+
31
+ export type TwentySeven = {
32
+ type: "flesch_reading_ease";
33
+ };
34
+
35
+ export type TwentySix = {
36
+ type: "most_repeated_words";
37
+ };
38
+
39
+ export type TwentyFive = {
40
+ type: "keywords_match";
41
+ keywords: Array<string>;
42
+ };
43
+
44
+ export type TwentyFour = {
45
+ type: "levenshtein_distance";
46
+ };
47
+
48
+ export type TwentyThree = {
49
+ type: "cosine_similarity";
50
+ };
51
+
52
+ export type TwentyTwo = {
53
+ type: "meteor_score";
54
+ };
55
+
56
+ export type TwentyOne = {
57
+ type: "rouge_n";
58
+ };
59
+
60
+ export type Twenty = {
61
+ type: "bleu_score";
62
+ };
63
+
64
+ export type Nineteen = {
65
+ type: "bert_score";
66
+ };
67
+
68
+ export type Eighteen = {
69
+ type: "moderations_google";
70
+ };
71
+
72
+ export type Seventeen = {
73
+ type: "moderations_openai";
74
+ };
75
+
76
+ export type Sixteen = {
77
+ type: "is_valid_json";
78
+ };
79
+
80
+ export type Fifteen = {
81
+ type: "regex";
82
+ pattern: string;
83
+ };
84
+
85
+ export type Fourteen = {
86
+ type: "one_line";
87
+ };
88
+
89
+ export type Thirteen = {
90
+ type: "length_greater_than";
91
+ value: number;
92
+ };
93
+
94
+ export type Twelve = {
95
+ type: "length_between";
96
+ min: number;
97
+ max: number;
98
+ };
99
+
100
+ export type Eleven = {
101
+ type: "length_less_than";
102
+ value: number;
103
+ };
104
+
105
+ export type Ten = {
106
+ type: "exact_match";
107
+ };
108
+
109
+ export type Nine = {
110
+ type: "ends_with";
111
+ value: string;
112
+ };
113
+
114
+ export type Eight = {
115
+ type: "start_with";
116
+ value: string;
117
+ };
118
+
119
+ export type Seven = {
120
+ type: "contains_valid_link";
121
+ };
122
+
123
+ export type Six = {
124
+ type: "contains_url";
125
+ };
126
+
127
+ export type Five = {
128
+ type: "contains_email";
129
+ };
130
+
131
+ export type Four = {
132
+ type: "contains_any";
133
+ keywords: Array<string>;
134
+ };
135
+
136
+ export type Three = {
137
+ type: "contains_all";
138
+ keywords: Array<string>;
139
+ };
140
+
141
+ export type FunctionParams2 = {
142
+ type: "contains_none";
143
+ keywords: Array<string>;
144
+ };
145
+
146
+ export type FunctionParams1 = {
147
+ type: "contains";
148
+ value: string;
149
+ };
150
+
151
+ export type FunctionParams =
152
+ | FunctionParams1
153
+ | FunctionParams2
154
+ | Three
155
+ | Four
156
+ | Five
157
+ | Six
158
+ | Seven
159
+ | Eight
160
+ | Nine
161
+ | Ten
162
+ | Eleven
163
+ | Twelve
164
+ | Thirteen
165
+ | Fourteen
166
+ | Fifteen
167
+ | Sixteen
168
+ | Seventeen
169
+ | Eighteen
170
+ | Nineteen
171
+ | Twenty
172
+ | TwentyOne
173
+ | TwentyTwo
174
+ | TwentyThree
175
+ | TwentyFour
176
+ | TwentyFive
177
+ | TwentySix
178
+ | TwentySeven
179
+ | TwentyEight
180
+ | TwentyNine
181
+ | Thirty
182
+ | ThirtyOne
183
+ | ThirtyTwo;
184
+
185
+ export type EvaluatorResponseFunction = {
186
+ id: string;
187
+ description: string;
188
+ created: string;
189
+ updated: string;
190
+ updatedById?: string | null | undefined;
191
+ /**
192
+ * Unique identifier of the project owning this evaluator.
193
+ */
194
+ projectId?: string | undefined;
195
+ guardrailConfig?: any | undefined;
196
+ type: "function_eval";
197
+ functionParams:
198
+ | FunctionParams1
199
+ | FunctionParams2
200
+ | Three
201
+ | Four
202
+ | Five
203
+ | Six
204
+ | Seven
205
+ | Eight
206
+ | Nine
207
+ | Ten
208
+ | Eleven
209
+ | Twelve
210
+ | Thirteen
211
+ | Fourteen
212
+ | Fifteen
213
+ | Sixteen
214
+ | Seventeen
215
+ | Eighteen
216
+ | Nineteen
217
+ | Twenty
218
+ | TwentyOne
219
+ | TwentyTwo
220
+ | TwentyThree
221
+ | TwentyFour
222
+ | TwentyFive
223
+ | TwentySix
224
+ | TwentySeven
225
+ | TwentyEight
226
+ | TwentyNine
227
+ | Thirty
228
+ | ThirtyOne
229
+ | ThirtyTwo;
230
+ key: string;
231
+ };
232
+
233
+ /** @internal */
234
+ export const ThirtyTwo$inboundSchema: z.ZodType<
235
+ ThirtyTwo,
236
+ z.ZodTypeDef,
237
+ unknown
238
+ > = z.object({
239
+ type: z.literal("grammar_diversity"),
240
+ });
241
+
242
+ export function thirtyTwoFromJSON(
243
+ jsonString: string,
244
+ ): SafeParseResult<ThirtyTwo, SDKValidationError> {
245
+ return safeParse(
246
+ jsonString,
247
+ (x) => ThirtyTwo$inboundSchema.parse(JSON.parse(x)),
248
+ `Failed to parse 'ThirtyTwo' from JSON`,
249
+ );
250
+ }
251
+
252
+ /** @internal */
253
+ export const ThirtyOne$inboundSchema: z.ZodType<
254
+ ThirtyOne,
255
+ z.ZodTypeDef,
256
+ unknown
257
+ > = z.object({
258
+ type: z.literal("lexical_repetition"),
259
+ });
260
+
261
+ export function thirtyOneFromJSON(
262
+ jsonString: string,
263
+ ): SafeParseResult<ThirtyOne, SDKValidationError> {
264
+ return safeParse(
265
+ jsonString,
266
+ (x) => ThirtyOne$inboundSchema.parse(JSON.parse(x)),
267
+ `Failed to parse 'ThirtyOne' from JSON`,
268
+ );
269
+ }
270
+
271
+ /** @internal */
272
+ export const Thirty$inboundSchema: z.ZodType<Thirty, z.ZodTypeDef, unknown> = z
273
+ .object({
274
+ type: z.literal("sentences_count"),
275
+ });
276
+
277
+ export function thirtyFromJSON(
278
+ jsonString: string,
279
+ ): SafeParseResult<Thirty, SDKValidationError> {
280
+ return safeParse(
281
+ jsonString,
282
+ (x) => Thirty$inboundSchema.parse(JSON.parse(x)),
283
+ `Failed to parse 'Thirty' from JSON`,
284
+ );
285
+ }
286
+
287
+ /** @internal */
288
+ export const TwentyNine$inboundSchema: z.ZodType<
289
+ TwentyNine,
290
+ z.ZodTypeDef,
291
+ unknown
292
+ > = z.object({
293
+ type: z.literal("words_count"),
294
+ });
295
+
296
+ export function twentyNineFromJSON(
297
+ jsonString: string,
298
+ ): SafeParseResult<TwentyNine, SDKValidationError> {
299
+ return safeParse(
300
+ jsonString,
301
+ (x) => TwentyNine$inboundSchema.parse(JSON.parse(x)),
302
+ `Failed to parse 'TwentyNine' from JSON`,
303
+ );
304
+ }
305
+
306
+ /** @internal */
307
+ export const TwentyEight$inboundSchema: z.ZodType<
308
+ TwentyEight,
309
+ z.ZodTypeDef,
310
+ unknown
311
+ > = z.object({
312
+ type: z.literal("gse_english_level"),
313
+ });
314
+
315
+ export function twentyEightFromJSON(
316
+ jsonString: string,
317
+ ): SafeParseResult<TwentyEight, SDKValidationError> {
318
+ return safeParse(
319
+ jsonString,
320
+ (x) => TwentyEight$inboundSchema.parse(JSON.parse(x)),
321
+ `Failed to parse 'TwentyEight' from JSON`,
322
+ );
323
+ }
324
+
325
+ /** @internal */
326
+ export const TwentySeven$inboundSchema: z.ZodType<
327
+ TwentySeven,
328
+ z.ZodTypeDef,
329
+ unknown
330
+ > = z.object({
331
+ type: z.literal("flesch_reading_ease"),
332
+ });
333
+
334
+ export function twentySevenFromJSON(
335
+ jsonString: string,
336
+ ): SafeParseResult<TwentySeven, SDKValidationError> {
337
+ return safeParse(
338
+ jsonString,
339
+ (x) => TwentySeven$inboundSchema.parse(JSON.parse(x)),
340
+ `Failed to parse 'TwentySeven' from JSON`,
341
+ );
342
+ }
343
+
344
+ /** @internal */
345
+ export const TwentySix$inboundSchema: z.ZodType<
346
+ TwentySix,
347
+ z.ZodTypeDef,
348
+ unknown
349
+ > = z.object({
350
+ type: z.literal("most_repeated_words"),
351
+ });
352
+
353
+ export function twentySixFromJSON(
354
+ jsonString: string,
355
+ ): SafeParseResult<TwentySix, SDKValidationError> {
356
+ return safeParse(
357
+ jsonString,
358
+ (x) => TwentySix$inboundSchema.parse(JSON.parse(x)),
359
+ `Failed to parse 'TwentySix' from JSON`,
360
+ );
361
+ }
362
+
363
+ /** @internal */
364
+ export const TwentyFive$inboundSchema: z.ZodType<
365
+ TwentyFive,
366
+ z.ZodTypeDef,
367
+ unknown
368
+ > = z.object({
369
+ type: z.literal("keywords_match"),
370
+ keywords: z.array(z.string()),
371
+ });
372
+
373
+ export function twentyFiveFromJSON(
374
+ jsonString: string,
375
+ ): SafeParseResult<TwentyFive, SDKValidationError> {
376
+ return safeParse(
377
+ jsonString,
378
+ (x) => TwentyFive$inboundSchema.parse(JSON.parse(x)),
379
+ `Failed to parse 'TwentyFive' from JSON`,
380
+ );
381
+ }
382
+
383
+ /** @internal */
384
+ export const TwentyFour$inboundSchema: z.ZodType<
385
+ TwentyFour,
386
+ z.ZodTypeDef,
387
+ unknown
388
+ > = z.object({
389
+ type: z.literal("levenshtein_distance"),
390
+ });
391
+
392
+ export function twentyFourFromJSON(
393
+ jsonString: string,
394
+ ): SafeParseResult<TwentyFour, SDKValidationError> {
395
+ return safeParse(
396
+ jsonString,
397
+ (x) => TwentyFour$inboundSchema.parse(JSON.parse(x)),
398
+ `Failed to parse 'TwentyFour' from JSON`,
399
+ );
400
+ }
401
+
402
+ /** @internal */
403
+ export const TwentyThree$inboundSchema: z.ZodType<
404
+ TwentyThree,
405
+ z.ZodTypeDef,
406
+ unknown
407
+ > = z.object({
408
+ type: z.literal("cosine_similarity"),
409
+ });
410
+
411
+ export function twentyThreeFromJSON(
412
+ jsonString: string,
413
+ ): SafeParseResult<TwentyThree, SDKValidationError> {
414
+ return safeParse(
415
+ jsonString,
416
+ (x) => TwentyThree$inboundSchema.parse(JSON.parse(x)),
417
+ `Failed to parse 'TwentyThree' from JSON`,
418
+ );
419
+ }
420
+
421
+ /** @internal */
422
+ export const TwentyTwo$inboundSchema: z.ZodType<
423
+ TwentyTwo,
424
+ z.ZodTypeDef,
425
+ unknown
426
+ > = z.object({
427
+ type: z.literal("meteor_score"),
428
+ });
429
+
430
+ export function twentyTwoFromJSON(
431
+ jsonString: string,
432
+ ): SafeParseResult<TwentyTwo, SDKValidationError> {
433
+ return safeParse(
434
+ jsonString,
435
+ (x) => TwentyTwo$inboundSchema.parse(JSON.parse(x)),
436
+ `Failed to parse 'TwentyTwo' from JSON`,
437
+ );
438
+ }
439
+
440
+ /** @internal */
441
+ export const TwentyOne$inboundSchema: z.ZodType<
442
+ TwentyOne,
443
+ z.ZodTypeDef,
444
+ unknown
445
+ > = z.object({
446
+ type: z.literal("rouge_n"),
447
+ });
448
+
449
+ export function twentyOneFromJSON(
450
+ jsonString: string,
451
+ ): SafeParseResult<TwentyOne, SDKValidationError> {
452
+ return safeParse(
453
+ jsonString,
454
+ (x) => TwentyOne$inboundSchema.parse(JSON.parse(x)),
455
+ `Failed to parse 'TwentyOne' from JSON`,
456
+ );
457
+ }
458
+
459
+ /** @internal */
460
+ export const Twenty$inboundSchema: z.ZodType<Twenty, z.ZodTypeDef, unknown> = z
461
+ .object({
462
+ type: z.literal("bleu_score"),
463
+ });
464
+
465
+ export function twentyFromJSON(
466
+ jsonString: string,
467
+ ): SafeParseResult<Twenty, SDKValidationError> {
468
+ return safeParse(
469
+ jsonString,
470
+ (x) => Twenty$inboundSchema.parse(JSON.parse(x)),
471
+ `Failed to parse 'Twenty' from JSON`,
472
+ );
473
+ }
474
+
475
+ /** @internal */
476
+ export const Nineteen$inboundSchema: z.ZodType<
477
+ Nineteen,
478
+ z.ZodTypeDef,
479
+ unknown
480
+ > = z.object({
481
+ type: z.literal("bert_score"),
482
+ });
483
+
484
+ export function nineteenFromJSON(
485
+ jsonString: string,
486
+ ): SafeParseResult<Nineteen, SDKValidationError> {
487
+ return safeParse(
488
+ jsonString,
489
+ (x) => Nineteen$inboundSchema.parse(JSON.parse(x)),
490
+ `Failed to parse 'Nineteen' from JSON`,
491
+ );
492
+ }
493
+
494
+ /** @internal */
495
+ export const Eighteen$inboundSchema: z.ZodType<
496
+ Eighteen,
497
+ z.ZodTypeDef,
498
+ unknown
499
+ > = z.object({
500
+ type: z.literal("moderations_google"),
501
+ });
502
+
503
+ export function eighteenFromJSON(
504
+ jsonString: string,
505
+ ): SafeParseResult<Eighteen, SDKValidationError> {
506
+ return safeParse(
507
+ jsonString,
508
+ (x) => Eighteen$inboundSchema.parse(JSON.parse(x)),
509
+ `Failed to parse 'Eighteen' from JSON`,
510
+ );
511
+ }
512
+
513
+ /** @internal */
514
+ export const Seventeen$inboundSchema: z.ZodType<
515
+ Seventeen,
516
+ z.ZodTypeDef,
517
+ unknown
518
+ > = z.object({
519
+ type: z.literal("moderations_openai"),
520
+ });
521
+
522
+ export function seventeenFromJSON(
523
+ jsonString: string,
524
+ ): SafeParseResult<Seventeen, SDKValidationError> {
525
+ return safeParse(
526
+ jsonString,
527
+ (x) => Seventeen$inboundSchema.parse(JSON.parse(x)),
528
+ `Failed to parse 'Seventeen' from JSON`,
529
+ );
530
+ }
531
+
532
+ /** @internal */
533
+ export const Sixteen$inboundSchema: z.ZodType<Sixteen, z.ZodTypeDef, unknown> =
534
+ z.object({
535
+ type: z.literal("is_valid_json"),
536
+ });
537
+
538
+ export function sixteenFromJSON(
539
+ jsonString: string,
540
+ ): SafeParseResult<Sixteen, SDKValidationError> {
541
+ return safeParse(
542
+ jsonString,
543
+ (x) => Sixteen$inboundSchema.parse(JSON.parse(x)),
544
+ `Failed to parse 'Sixteen' from JSON`,
545
+ );
546
+ }
547
+
548
+ /** @internal */
549
+ export const Fifteen$inboundSchema: z.ZodType<Fifteen, z.ZodTypeDef, unknown> =
550
+ z.object({
551
+ type: z.literal("regex"),
552
+ pattern: z.string(),
553
+ });
554
+
555
+ export function fifteenFromJSON(
556
+ jsonString: string,
557
+ ): SafeParseResult<Fifteen, SDKValidationError> {
558
+ return safeParse(
559
+ jsonString,
560
+ (x) => Fifteen$inboundSchema.parse(JSON.parse(x)),
561
+ `Failed to parse 'Fifteen' from JSON`,
562
+ );
563
+ }
564
+
565
+ /** @internal */
566
+ export const Fourteen$inboundSchema: z.ZodType<
567
+ Fourteen,
568
+ z.ZodTypeDef,
569
+ unknown
570
+ > = z.object({
571
+ type: z.literal("one_line"),
572
+ });
573
+
574
+ export function fourteenFromJSON(
575
+ jsonString: string,
576
+ ): SafeParseResult<Fourteen, SDKValidationError> {
577
+ return safeParse(
578
+ jsonString,
579
+ (x) => Fourteen$inboundSchema.parse(JSON.parse(x)),
580
+ `Failed to parse 'Fourteen' from JSON`,
581
+ );
582
+ }
583
+
584
+ /** @internal */
585
+ export const Thirteen$inboundSchema: z.ZodType<
586
+ Thirteen,
587
+ z.ZodTypeDef,
588
+ unknown
589
+ > = z.object({
590
+ type: z.literal("length_greater_than"),
591
+ value: z.number(),
592
+ });
593
+
594
+ export function thirteenFromJSON(
595
+ jsonString: string,
596
+ ): SafeParseResult<Thirteen, SDKValidationError> {
597
+ return safeParse(
598
+ jsonString,
599
+ (x) => Thirteen$inboundSchema.parse(JSON.parse(x)),
600
+ `Failed to parse 'Thirteen' from JSON`,
601
+ );
602
+ }
603
+
604
+ /** @internal */
605
+ export const Twelve$inboundSchema: z.ZodType<Twelve, z.ZodTypeDef, unknown> = z
606
+ .object({
607
+ type: z.literal("length_between"),
608
+ min: z.number(),
609
+ max: z.number(),
610
+ });
611
+
612
+ export function twelveFromJSON(
613
+ jsonString: string,
614
+ ): SafeParseResult<Twelve, SDKValidationError> {
615
+ return safeParse(
616
+ jsonString,
617
+ (x) => Twelve$inboundSchema.parse(JSON.parse(x)),
618
+ `Failed to parse 'Twelve' from JSON`,
619
+ );
620
+ }
621
+
622
+ /** @internal */
623
+ export const Eleven$inboundSchema: z.ZodType<Eleven, z.ZodTypeDef, unknown> = z
624
+ .object({
625
+ type: z.literal("length_less_than"),
626
+ value: z.number(),
627
+ });
628
+
629
+ export function elevenFromJSON(
630
+ jsonString: string,
631
+ ): SafeParseResult<Eleven, SDKValidationError> {
632
+ return safeParse(
633
+ jsonString,
634
+ (x) => Eleven$inboundSchema.parse(JSON.parse(x)),
635
+ `Failed to parse 'Eleven' from JSON`,
636
+ );
637
+ }
638
+
639
+ /** @internal */
640
+ export const Ten$inboundSchema: z.ZodType<Ten, z.ZodTypeDef, unknown> = z
641
+ .object({
642
+ type: z.literal("exact_match"),
643
+ });
644
+
645
+ export function tenFromJSON(
646
+ jsonString: string,
647
+ ): SafeParseResult<Ten, SDKValidationError> {
648
+ return safeParse(
649
+ jsonString,
650
+ (x) => Ten$inboundSchema.parse(JSON.parse(x)),
651
+ `Failed to parse 'Ten' from JSON`,
652
+ );
653
+ }
654
+
655
+ /** @internal */
656
+ export const Nine$inboundSchema: z.ZodType<Nine, z.ZodTypeDef, unknown> = z
657
+ .object({
658
+ type: z.literal("ends_with"),
659
+ value: z.string(),
660
+ });
661
+
662
+ export function nineFromJSON(
663
+ jsonString: string,
664
+ ): SafeParseResult<Nine, SDKValidationError> {
665
+ return safeParse(
666
+ jsonString,
667
+ (x) => Nine$inboundSchema.parse(JSON.parse(x)),
668
+ `Failed to parse 'Nine' from JSON`,
669
+ );
670
+ }
671
+
672
+ /** @internal */
673
+ export const Eight$inboundSchema: z.ZodType<Eight, z.ZodTypeDef, unknown> = z
674
+ .object({
675
+ type: z.literal("start_with"),
676
+ value: z.string(),
677
+ });
678
+
679
+ export function eightFromJSON(
680
+ jsonString: string,
681
+ ): SafeParseResult<Eight, SDKValidationError> {
682
+ return safeParse(
683
+ jsonString,
684
+ (x) => Eight$inboundSchema.parse(JSON.parse(x)),
685
+ `Failed to parse 'Eight' from JSON`,
686
+ );
687
+ }
688
+
689
+ /** @internal */
690
+ export const Seven$inboundSchema: z.ZodType<Seven, z.ZodTypeDef, unknown> = z
691
+ .object({
692
+ type: z.literal("contains_valid_link"),
693
+ });
694
+
695
+ export function sevenFromJSON(
696
+ jsonString: string,
697
+ ): SafeParseResult<Seven, SDKValidationError> {
698
+ return safeParse(
699
+ jsonString,
700
+ (x) => Seven$inboundSchema.parse(JSON.parse(x)),
701
+ `Failed to parse 'Seven' from JSON`,
702
+ );
703
+ }
704
+
705
+ /** @internal */
706
+ export const Six$inboundSchema: z.ZodType<Six, z.ZodTypeDef, unknown> = z
707
+ .object({
708
+ type: z.literal("contains_url"),
709
+ });
710
+
711
+ export function sixFromJSON(
712
+ jsonString: string,
713
+ ): SafeParseResult<Six, SDKValidationError> {
714
+ return safeParse(
715
+ jsonString,
716
+ (x) => Six$inboundSchema.parse(JSON.parse(x)),
717
+ `Failed to parse 'Six' from JSON`,
718
+ );
719
+ }
720
+
721
+ /** @internal */
722
+ export const Five$inboundSchema: z.ZodType<Five, z.ZodTypeDef, unknown> = z
723
+ .object({
724
+ type: z.literal("contains_email"),
725
+ });
726
+
727
+ export function fiveFromJSON(
728
+ jsonString: string,
729
+ ): SafeParseResult<Five, SDKValidationError> {
730
+ return safeParse(
731
+ jsonString,
732
+ (x) => Five$inboundSchema.parse(JSON.parse(x)),
733
+ `Failed to parse 'Five' from JSON`,
734
+ );
735
+ }
736
+
737
+ /** @internal */
738
+ export const Four$inboundSchema: z.ZodType<Four, z.ZodTypeDef, unknown> = z
739
+ .object({
740
+ type: z.literal("contains_any"),
741
+ keywords: z.array(z.string()),
742
+ });
743
+
744
+ export function fourFromJSON(
745
+ jsonString: string,
746
+ ): SafeParseResult<Four, SDKValidationError> {
747
+ return safeParse(
748
+ jsonString,
749
+ (x) => Four$inboundSchema.parse(JSON.parse(x)),
750
+ `Failed to parse 'Four' from JSON`,
751
+ );
752
+ }
753
+
754
+ /** @internal */
755
+ export const Three$inboundSchema: z.ZodType<Three, z.ZodTypeDef, unknown> = z
756
+ .object({
757
+ type: z.literal("contains_all"),
758
+ keywords: z.array(z.string()),
759
+ });
760
+
761
+ export function threeFromJSON(
762
+ jsonString: string,
763
+ ): SafeParseResult<Three, SDKValidationError> {
764
+ return safeParse(
765
+ jsonString,
766
+ (x) => Three$inboundSchema.parse(JSON.parse(x)),
767
+ `Failed to parse 'Three' from JSON`,
768
+ );
769
+ }
770
+
771
+ /** @internal */
772
+ export const FunctionParams2$inboundSchema: z.ZodType<
773
+ FunctionParams2,
774
+ z.ZodTypeDef,
775
+ unknown
776
+ > = z.object({
777
+ type: z.literal("contains_none"),
778
+ keywords: z.array(z.string()),
779
+ });
780
+
781
+ export function functionParams2FromJSON(
782
+ jsonString: string,
783
+ ): SafeParseResult<FunctionParams2, SDKValidationError> {
784
+ return safeParse(
785
+ jsonString,
786
+ (x) => FunctionParams2$inboundSchema.parse(JSON.parse(x)),
787
+ `Failed to parse 'FunctionParams2' from JSON`,
788
+ );
789
+ }
790
+
791
+ /** @internal */
792
+ export const FunctionParams1$inboundSchema: z.ZodType<
793
+ FunctionParams1,
794
+ z.ZodTypeDef,
795
+ unknown
796
+ > = z.object({
797
+ type: z.literal("contains"),
798
+ value: z.string(),
799
+ });
800
+
801
+ export function functionParams1FromJSON(
802
+ jsonString: string,
803
+ ): SafeParseResult<FunctionParams1, SDKValidationError> {
804
+ return safeParse(
805
+ jsonString,
806
+ (x) => FunctionParams1$inboundSchema.parse(JSON.parse(x)),
807
+ `Failed to parse 'FunctionParams1' from JSON`,
808
+ );
809
+ }
810
+
811
+ /** @internal */
812
+ export const FunctionParams$inboundSchema: z.ZodType<
813
+ FunctionParams,
814
+ z.ZodTypeDef,
815
+ unknown
816
+ > = z.union([
817
+ z.lazy(() => FunctionParams1$inboundSchema),
818
+ z.lazy(() => FunctionParams2$inboundSchema),
819
+ z.lazy(() => Three$inboundSchema),
820
+ z.lazy(() => Four$inboundSchema),
821
+ z.lazy(() => Five$inboundSchema),
822
+ z.lazy(() => Six$inboundSchema),
823
+ z.lazy(() => Seven$inboundSchema),
824
+ z.lazy(() => Eight$inboundSchema),
825
+ z.lazy(() => Nine$inboundSchema),
826
+ z.lazy(() => Ten$inboundSchema),
827
+ z.lazy(() => Eleven$inboundSchema),
828
+ z.lazy(() => Twelve$inboundSchema),
829
+ z.lazy(() => Thirteen$inboundSchema),
830
+ z.lazy(() => Fourteen$inboundSchema),
831
+ z.lazy(() => Fifteen$inboundSchema),
832
+ z.lazy(() => Sixteen$inboundSchema),
833
+ z.lazy(() => Seventeen$inboundSchema),
834
+ z.lazy(() => Eighteen$inboundSchema),
835
+ z.lazy(() => Nineteen$inboundSchema),
836
+ z.lazy(() => Twenty$inboundSchema),
837
+ z.lazy(() => TwentyOne$inboundSchema),
838
+ z.lazy(() => TwentyTwo$inboundSchema),
839
+ z.lazy(() => TwentyThree$inboundSchema),
840
+ z.lazy(() => TwentyFour$inboundSchema),
841
+ z.lazy(() => TwentyFive$inboundSchema),
842
+ z.lazy(() => TwentySix$inboundSchema),
843
+ z.lazy(() => TwentySeven$inboundSchema),
844
+ z.lazy(() => TwentyEight$inboundSchema),
845
+ z.lazy(() => TwentyNine$inboundSchema),
846
+ z.lazy(() => Thirty$inboundSchema),
847
+ z.lazy(() => ThirtyOne$inboundSchema),
848
+ z.lazy(() => ThirtyTwo$inboundSchema),
849
+ ]);
850
+
851
+ export function functionParamsFromJSON(
852
+ jsonString: string,
853
+ ): SafeParseResult<FunctionParams, SDKValidationError> {
854
+ return safeParse(
855
+ jsonString,
856
+ (x) => FunctionParams$inboundSchema.parse(JSON.parse(x)),
857
+ `Failed to parse 'FunctionParams' from JSON`,
858
+ );
859
+ }
860
+
861
+ /** @internal */
862
+ export const EvaluatorResponseFunction$inboundSchema: z.ZodType<
863
+ EvaluatorResponseFunction,
864
+ z.ZodTypeDef,
865
+ unknown
866
+ > = z.object({
867
+ _id: z.string(),
868
+ description: z.string(),
869
+ created: z.string().default("2026-08-05T15:12:51.947Z"),
870
+ updated: z.string().default("2026-08-05T15:12:51.947Z"),
871
+ updated_by_id: z.nullable(z.string()).optional(),
872
+ project_id: z.string().optional(),
873
+ guardrail_config: z.any().optional(),
874
+ type: z.literal("function_eval"),
875
+ function_params: z.union([
876
+ z.lazy(() => FunctionParams1$inboundSchema),
877
+ z.lazy(() => FunctionParams2$inboundSchema),
878
+ z.lazy(() => Three$inboundSchema),
879
+ z.lazy(() => Four$inboundSchema),
880
+ z.lazy(() => Five$inboundSchema),
881
+ z.lazy(() => Six$inboundSchema),
882
+ z.lazy(() => Seven$inboundSchema),
883
+ z.lazy(() => Eight$inboundSchema),
884
+ z.lazy(() => Nine$inboundSchema),
885
+ z.lazy(() => Ten$inboundSchema),
886
+ z.lazy(() => Eleven$inboundSchema),
887
+ z.lazy(() => Twelve$inboundSchema),
888
+ z.lazy(() => Thirteen$inboundSchema),
889
+ z.lazy(() => Fourteen$inboundSchema),
890
+ z.lazy(() => Fifteen$inboundSchema),
891
+ z.lazy(() => Sixteen$inboundSchema),
892
+ z.lazy(() => Seventeen$inboundSchema),
893
+ z.lazy(() => Eighteen$inboundSchema),
894
+ z.lazy(() => Nineteen$inboundSchema),
895
+ z.lazy(() => Twenty$inboundSchema),
896
+ z.lazy(() => TwentyOne$inboundSchema),
897
+ z.lazy(() => TwentyTwo$inboundSchema),
898
+ z.lazy(() => TwentyThree$inboundSchema),
899
+ z.lazy(() => TwentyFour$inboundSchema),
900
+ z.lazy(() => TwentyFive$inboundSchema),
901
+ z.lazy(() => TwentySix$inboundSchema),
902
+ z.lazy(() => TwentySeven$inboundSchema),
903
+ z.lazy(() => TwentyEight$inboundSchema),
904
+ z.lazy(() => TwentyNine$inboundSchema),
905
+ z.lazy(() => Thirty$inboundSchema),
906
+ z.lazy(() => ThirtyOne$inboundSchema),
907
+ z.lazy(() => ThirtyTwo$inboundSchema),
908
+ ]),
909
+ key: z.string(),
910
+ }).transform((v) => {
911
+ return remap$(v, {
912
+ "_id": "id",
913
+ "updated_by_id": "updatedById",
914
+ "project_id": "projectId",
915
+ "guardrail_config": "guardrailConfig",
916
+ "function_params": "functionParams",
917
+ });
918
+ });
919
+
920
+ export function evaluatorResponseFunctionFromJSON(
921
+ jsonString: string,
922
+ ): SafeParseResult<EvaluatorResponseFunction, SDKValidationError> {
923
+ return safeParse(
924
+ jsonString,
925
+ (x) => EvaluatorResponseFunction$inboundSchema.parse(JSON.parse(x)),
926
+ `Failed to parse 'EvaluatorResponseFunction' from JSON`,
927
+ );
928
+ }