@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
@@ -3,26 +3,640 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
7
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import * as components from "../components/index.js";
8
11
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
12
 
10
- export type CreateEvalRequestBody = {};
13
+ export const OutputType = {
14
+ Boolean: "boolean",
15
+ Number: "number",
16
+ } as const;
17
+ export type OutputType = ClosedEnum<typeof OutputType>;
18
+
19
+ export const CreateEvalRequestBodyType = {
20
+ PythonEval: "python_eval",
21
+ } as const;
22
+ export type CreateEvalRequestBodyType = ClosedEnum<
23
+ typeof CreateEvalRequestBodyType
24
+ >;
25
+
26
+ export type Python = {
27
+ guardrailConfig?: any | undefined;
28
+ outputType?: OutputType | undefined;
29
+ code: string;
30
+ type: CreateEvalRequestBodyType;
31
+ /**
32
+ * Legacy alternative to `project_id`. Storage path whose first segment names the project that owns the evaluator. Mutually exclusive with `project_id`.
33
+ */
34
+ path?: string | undefined;
35
+ /**
36
+ * Unique identifier of the project that owns the evaluator, as returned by `GET /v2/projects`. Mutually exclusive with `path`.
37
+ */
38
+ projectId?: string | undefined;
39
+ description?: string | undefined;
40
+ key: string;
41
+ };
42
+
43
+ /**
44
+ * The type of output expected from the evaluator
45
+ */
46
+ export const OneOutputType = {
47
+ Boolean: "boolean",
48
+ Categorical: "categorical",
49
+ Number: "number",
50
+ String: "string",
51
+ } as const;
52
+ /**
53
+ * The type of output expected from the evaluator
54
+ */
55
+ export type OneOutputType = ClosedEnum<typeof OneOutputType>;
56
+
57
+ export const CreateEval1Type = {
58
+ LlmEval: "llm_eval",
59
+ } as const;
60
+ export type CreateEval1Type = ClosedEnum<typeof CreateEval1Type>;
61
+
62
+ export type OneCategoricalLabels = {
63
+ value: string;
64
+ description?: string | undefined;
65
+ };
66
+
67
+ export type OneRetry = {
68
+ count?: number | undefined;
69
+ onCodes?: Array<number> | undefined;
70
+ };
71
+
72
+ export type OneFallbacks = {
73
+ model: string;
74
+ };
75
+
76
+ export type OneJudges = {
77
+ model: string;
78
+ retry?: OneRetry | undefined;
79
+ fallbacks?: Array<OneFallbacks> | undefined;
80
+ };
81
+
82
+ export type CreateEval1Retry = {
83
+ count?: number | undefined;
84
+ onCodes?: Array<number> | undefined;
85
+ };
86
+
87
+ export type CreateEval1Fallbacks = {
88
+ model: string;
89
+ };
90
+
91
+ export type OneReplacementJudges = {
92
+ model: string;
93
+ retry?: CreateEval1Retry | undefined;
94
+ fallbacks?: Array<CreateEval1Fallbacks> | undefined;
95
+ };
96
+
97
+ export const OneTieValue = {
98
+ Tie: "Tie",
99
+ } as const;
100
+ export type OneTieValue = ClosedEnum<typeof OneTieValue>;
101
+
102
+ export type OneJury = {
103
+ judges: Array<OneJudges>;
104
+ replacementJudges?: Array<OneReplacementJudges> | undefined;
105
+ minSuccessfulJudges?: number | undefined;
106
+ tieValue?: OneTieValue | undefined;
107
+ };
108
+
109
+ export type LLMJury = {
110
+ guardrailConfig?: any | undefined;
111
+ /**
112
+ * The type of output expected from the evaluator
113
+ */
114
+ outputType?: OneOutputType | undefined;
115
+ type: CreateEval1Type;
116
+ repetitions?: number | null | undefined;
117
+ prompt: string;
118
+ categories?: Array<string> | null | undefined;
119
+ categoricalLabels?: Array<OneCategoricalLabels> | null | undefined;
120
+ datasetId?: string | null | undefined;
121
+ /**
122
+ * Legacy alternative to `project_id`. Storage path whose first segment names the project that owns the evaluator. Mutually exclusive with `project_id`.
123
+ */
124
+ path?: string | undefined;
125
+ /**
126
+ * Unique identifier of the project that owns the evaluator, as returned by `GET /v2/projects`. Mutually exclusive with `path`.
127
+ */
128
+ projectId?: string | undefined;
129
+ description?: string | undefined;
130
+ key: string;
131
+ mode: "jury";
132
+ jury: OneJury;
133
+ };
134
+
135
+ /**
136
+ * The type of output expected from the evaluator
137
+ */
138
+ export const CreateEval1OutputType = {
139
+ Boolean: "boolean",
140
+ Categorical: "categorical",
141
+ Number: "number",
142
+ String: "string",
143
+ } as const;
144
+ /**
145
+ * The type of output expected from the evaluator
146
+ */
147
+ export type CreateEval1OutputType = ClosedEnum<typeof CreateEval1OutputType>;
148
+
149
+ export const OneType = {
150
+ LlmEval: "llm_eval",
151
+ } as const;
152
+ export type OneType = ClosedEnum<typeof OneType>;
153
+
154
+ export type CreateEval1CategoricalLabels = {
155
+ value: string;
156
+ description?: string | undefined;
157
+ };
158
+
159
+ export type Llm = {
160
+ guardrailConfig?: any | undefined;
161
+ /**
162
+ * The type of output expected from the evaluator
163
+ */
164
+ outputType?: CreateEval1OutputType | undefined;
165
+ type: OneType;
166
+ repetitions?: number | null | undefined;
167
+ prompt: string;
168
+ categories?: Array<string> | null | undefined;
169
+ categoricalLabels?: Array<CreateEval1CategoricalLabels> | null | undefined;
170
+ datasetId?: string | null | undefined;
171
+ /**
172
+ * Legacy alternative to `project_id`. Storage path whose first segment names the project that owns the evaluator. Mutually exclusive with `project_id`.
173
+ */
174
+ path?: string | undefined;
175
+ /**
176
+ * Unique identifier of the project that owns the evaluator, as returned by `GET /v2/projects`. Mutually exclusive with `path`.
177
+ */
178
+ projectId?: string | undefined;
179
+ description?: string | undefined;
180
+ key: string;
181
+ mode: "single";
182
+ model: string;
183
+ };
184
+
185
+ export type CreateEvalRequestBody1 = Llm | LLMJury;
186
+
187
+ export type CreateEvalRequestBody = Python | Llm | LLMJury;
11
188
 
12
189
  /**
13
- * OK
190
+ * Successfully created an evaluator
14
191
  */
15
- export type CreateEvalResponseBody = {};
192
+ export type CreateEvalResponseBody =
193
+ | components.EvaluatorResponseLlm
194
+ | components.EvaluatorResponseJsonSchema
195
+ | components.EvaluatorResponseHttp
196
+ | components.EvaluatorResponsePython
197
+ | components.EvaluatorResponseFunction
198
+ | components.EvaluatorResponseRagas
199
+ | components.EvaluatorResponseTypescript;
200
+
201
+ /** @internal */
202
+ export const OutputType$outboundSchema: z.ZodNativeEnum<typeof OutputType> = z
203
+ .nativeEnum(OutputType);
204
+
205
+ /** @internal */
206
+ export const CreateEvalRequestBodyType$outboundSchema: z.ZodNativeEnum<
207
+ typeof CreateEvalRequestBodyType
208
+ > = z.nativeEnum(CreateEvalRequestBodyType);
209
+
210
+ /** @internal */
211
+ export type Python$Outbound = {
212
+ guardrail_config?: any | undefined;
213
+ output_type?: string | undefined;
214
+ code: string;
215
+ type: string;
216
+ path?: string | undefined;
217
+ project_id?: string | undefined;
218
+ description: string;
219
+ key: string;
220
+ };
221
+
222
+ /** @internal */
223
+ export const Python$outboundSchema: z.ZodType<
224
+ Python$Outbound,
225
+ z.ZodTypeDef,
226
+ Python
227
+ > = z.object({
228
+ guardrailConfig: z.any().optional(),
229
+ outputType: OutputType$outboundSchema.optional(),
230
+ code: z.string(),
231
+ type: CreateEvalRequestBodyType$outboundSchema,
232
+ path: z.string().optional(),
233
+ projectId: z.string().optional(),
234
+ description: z.string().default(""),
235
+ key: z.string(),
236
+ }).transform((v) => {
237
+ return remap$(v, {
238
+ guardrailConfig: "guardrail_config",
239
+ outputType: "output_type",
240
+ projectId: "project_id",
241
+ });
242
+ });
243
+
244
+ export function pythonToJSON(python: Python): string {
245
+ return JSON.stringify(Python$outboundSchema.parse(python));
246
+ }
247
+
248
+ /** @internal */
249
+ export const OneOutputType$outboundSchema: z.ZodNativeEnum<
250
+ typeof OneOutputType
251
+ > = z.nativeEnum(OneOutputType);
252
+
253
+ /** @internal */
254
+ export const CreateEval1Type$outboundSchema: z.ZodNativeEnum<
255
+ typeof CreateEval1Type
256
+ > = z.nativeEnum(CreateEval1Type);
257
+
258
+ /** @internal */
259
+ export type OneCategoricalLabels$Outbound = {
260
+ value: string;
261
+ description?: string | undefined;
262
+ };
263
+
264
+ /** @internal */
265
+ export const OneCategoricalLabels$outboundSchema: z.ZodType<
266
+ OneCategoricalLabels$Outbound,
267
+ z.ZodTypeDef,
268
+ OneCategoricalLabels
269
+ > = z.object({
270
+ value: z.string(),
271
+ description: z.string().optional(),
272
+ });
273
+
274
+ export function oneCategoricalLabelsToJSON(
275
+ oneCategoricalLabels: OneCategoricalLabels,
276
+ ): string {
277
+ return JSON.stringify(
278
+ OneCategoricalLabels$outboundSchema.parse(oneCategoricalLabels),
279
+ );
280
+ }
281
+
282
+ /** @internal */
283
+ export type OneRetry$Outbound = {
284
+ count: number;
285
+ on_codes?: Array<number> | undefined;
286
+ };
287
+
288
+ /** @internal */
289
+ export const OneRetry$outboundSchema: z.ZodType<
290
+ OneRetry$Outbound,
291
+ z.ZodTypeDef,
292
+ OneRetry
293
+ > = z.object({
294
+ count: z.number().int().default(2),
295
+ onCodes: z.array(z.number().int()).optional(),
296
+ }).transform((v) => {
297
+ return remap$(v, {
298
+ onCodes: "on_codes",
299
+ });
300
+ });
301
+
302
+ export function oneRetryToJSON(oneRetry: OneRetry): string {
303
+ return JSON.stringify(OneRetry$outboundSchema.parse(oneRetry));
304
+ }
305
+
306
+ /** @internal */
307
+ export type OneFallbacks$Outbound = {
308
+ model: string;
309
+ };
310
+
311
+ /** @internal */
312
+ export const OneFallbacks$outboundSchema: z.ZodType<
313
+ OneFallbacks$Outbound,
314
+ z.ZodTypeDef,
315
+ OneFallbacks
316
+ > = z.object({
317
+ model: z.string(),
318
+ });
319
+
320
+ export function oneFallbacksToJSON(oneFallbacks: OneFallbacks): string {
321
+ return JSON.stringify(OneFallbacks$outboundSchema.parse(oneFallbacks));
322
+ }
323
+
324
+ /** @internal */
325
+ export type OneJudges$Outbound = {
326
+ model: string;
327
+ retry?: OneRetry$Outbound | undefined;
328
+ fallbacks?: Array<OneFallbacks$Outbound> | undefined;
329
+ };
330
+
331
+ /** @internal */
332
+ export const OneJudges$outboundSchema: z.ZodType<
333
+ OneJudges$Outbound,
334
+ z.ZodTypeDef,
335
+ OneJudges
336
+ > = z.object({
337
+ model: z.string(),
338
+ retry: z.lazy(() => OneRetry$outboundSchema).optional(),
339
+ fallbacks: z.array(z.lazy(() => OneFallbacks$outboundSchema)).optional(),
340
+ });
341
+
342
+ export function oneJudgesToJSON(oneJudges: OneJudges): string {
343
+ return JSON.stringify(OneJudges$outboundSchema.parse(oneJudges));
344
+ }
345
+
346
+ /** @internal */
347
+ export type CreateEval1Retry$Outbound = {
348
+ count: number;
349
+ on_codes?: Array<number> | undefined;
350
+ };
351
+
352
+ /** @internal */
353
+ export const CreateEval1Retry$outboundSchema: z.ZodType<
354
+ CreateEval1Retry$Outbound,
355
+ z.ZodTypeDef,
356
+ CreateEval1Retry
357
+ > = z.object({
358
+ count: z.number().int().default(2),
359
+ onCodes: z.array(z.number().int()).optional(),
360
+ }).transform((v) => {
361
+ return remap$(v, {
362
+ onCodes: "on_codes",
363
+ });
364
+ });
365
+
366
+ export function createEval1RetryToJSON(
367
+ createEval1Retry: CreateEval1Retry,
368
+ ): string {
369
+ return JSON.stringify(
370
+ CreateEval1Retry$outboundSchema.parse(createEval1Retry),
371
+ );
372
+ }
373
+
374
+ /** @internal */
375
+ export type CreateEval1Fallbacks$Outbound = {
376
+ model: string;
377
+ };
378
+
379
+ /** @internal */
380
+ export const CreateEval1Fallbacks$outboundSchema: z.ZodType<
381
+ CreateEval1Fallbacks$Outbound,
382
+ z.ZodTypeDef,
383
+ CreateEval1Fallbacks
384
+ > = z.object({
385
+ model: z.string(),
386
+ });
387
+
388
+ export function createEval1FallbacksToJSON(
389
+ createEval1Fallbacks: CreateEval1Fallbacks,
390
+ ): string {
391
+ return JSON.stringify(
392
+ CreateEval1Fallbacks$outboundSchema.parse(createEval1Fallbacks),
393
+ );
394
+ }
395
+
396
+ /** @internal */
397
+ export type OneReplacementJudges$Outbound = {
398
+ model: string;
399
+ retry?: CreateEval1Retry$Outbound | undefined;
400
+ fallbacks?: Array<CreateEval1Fallbacks$Outbound> | undefined;
401
+ };
402
+
403
+ /** @internal */
404
+ export const OneReplacementJudges$outboundSchema: z.ZodType<
405
+ OneReplacementJudges$Outbound,
406
+ z.ZodTypeDef,
407
+ OneReplacementJudges
408
+ > = z.object({
409
+ model: z.string(),
410
+ retry: z.lazy(() => CreateEval1Retry$outboundSchema).optional(),
411
+ fallbacks: z.array(z.lazy(() => CreateEval1Fallbacks$outboundSchema))
412
+ .optional(),
413
+ });
414
+
415
+ export function oneReplacementJudgesToJSON(
416
+ oneReplacementJudges: OneReplacementJudges,
417
+ ): string {
418
+ return JSON.stringify(
419
+ OneReplacementJudges$outboundSchema.parse(oneReplacementJudges),
420
+ );
421
+ }
422
+
423
+ /** @internal */
424
+ export const OneTieValue$outboundSchema: z.ZodNativeEnum<typeof OneTieValue> = z
425
+ .nativeEnum(OneTieValue);
426
+
427
+ /** @internal */
428
+ export type OneJury$Outbound = {
429
+ judges: Array<OneJudges$Outbound>;
430
+ replacement_judges?: Array<OneReplacementJudges$Outbound> | undefined;
431
+ min_successful_judges: number;
432
+ tie_value: string;
433
+ };
434
+
435
+ /** @internal */
436
+ export const OneJury$outboundSchema: z.ZodType<
437
+ OneJury$Outbound,
438
+ z.ZodTypeDef,
439
+ OneJury
440
+ > = z.object({
441
+ judges: z.array(z.lazy(() => OneJudges$outboundSchema)),
442
+ replacementJudges: z.array(z.lazy(() => OneReplacementJudges$outboundSchema))
443
+ .optional(),
444
+ minSuccessfulJudges: z.number().int().default(2),
445
+ tieValue: OneTieValue$outboundSchema.default("Tie"),
446
+ }).transform((v) => {
447
+ return remap$(v, {
448
+ replacementJudges: "replacement_judges",
449
+ minSuccessfulJudges: "min_successful_judges",
450
+ tieValue: "tie_value",
451
+ });
452
+ });
453
+
454
+ export function oneJuryToJSON(oneJury: OneJury): string {
455
+ return JSON.stringify(OneJury$outboundSchema.parse(oneJury));
456
+ }
457
+
458
+ /** @internal */
459
+ export type LLMJury$Outbound = {
460
+ guardrail_config?: any | undefined;
461
+ output_type?: string | undefined;
462
+ type: string;
463
+ repetitions?: number | null | undefined;
464
+ prompt: string;
465
+ categories?: Array<string> | null | undefined;
466
+ categorical_labels?: Array<OneCategoricalLabels$Outbound> | null | undefined;
467
+ dataset_id?: string | null | undefined;
468
+ path?: string | undefined;
469
+ project_id?: string | undefined;
470
+ description: string;
471
+ key: string;
472
+ mode: "jury";
473
+ jury: OneJury$Outbound;
474
+ };
475
+
476
+ /** @internal */
477
+ export const LLMJury$outboundSchema: z.ZodType<
478
+ LLMJury$Outbound,
479
+ z.ZodTypeDef,
480
+ LLMJury
481
+ > = z.object({
482
+ guardrailConfig: z.any().optional(),
483
+ outputType: OneOutputType$outboundSchema.optional(),
484
+ type: CreateEval1Type$outboundSchema,
485
+ repetitions: z.nullable(z.number().int()).optional(),
486
+ prompt: z.string(),
487
+ categories: z.nullable(z.array(z.string())).optional(),
488
+ categoricalLabels: z.nullable(
489
+ z.array(z.lazy(() => OneCategoricalLabels$outboundSchema)),
490
+ ).optional(),
491
+ datasetId: z.nullable(z.string()).optional(),
492
+ path: z.string().optional(),
493
+ projectId: z.string().optional(),
494
+ description: z.string().default(""),
495
+ key: z.string(),
496
+ mode: z.literal("jury"),
497
+ jury: z.lazy(() => OneJury$outboundSchema),
498
+ }).transform((v) => {
499
+ return remap$(v, {
500
+ guardrailConfig: "guardrail_config",
501
+ outputType: "output_type",
502
+ categoricalLabels: "categorical_labels",
503
+ datasetId: "dataset_id",
504
+ projectId: "project_id",
505
+ });
506
+ });
507
+
508
+ export function llmJuryToJSON(llmJury: LLMJury): string {
509
+ return JSON.stringify(LLMJury$outboundSchema.parse(llmJury));
510
+ }
511
+
512
+ /** @internal */
513
+ export const CreateEval1OutputType$outboundSchema: z.ZodNativeEnum<
514
+ typeof CreateEval1OutputType
515
+ > = z.nativeEnum(CreateEval1OutputType);
516
+
517
+ /** @internal */
518
+ export const OneType$outboundSchema: z.ZodNativeEnum<typeof OneType> = z
519
+ .nativeEnum(OneType);
520
+
521
+ /** @internal */
522
+ export type CreateEval1CategoricalLabels$Outbound = {
523
+ value: string;
524
+ description?: string | undefined;
525
+ };
526
+
527
+ /** @internal */
528
+ export const CreateEval1CategoricalLabels$outboundSchema: z.ZodType<
529
+ CreateEval1CategoricalLabels$Outbound,
530
+ z.ZodTypeDef,
531
+ CreateEval1CategoricalLabels
532
+ > = z.object({
533
+ value: z.string(),
534
+ description: z.string().optional(),
535
+ });
536
+
537
+ export function createEval1CategoricalLabelsToJSON(
538
+ createEval1CategoricalLabels: CreateEval1CategoricalLabels,
539
+ ): string {
540
+ return JSON.stringify(
541
+ CreateEval1CategoricalLabels$outboundSchema.parse(
542
+ createEval1CategoricalLabels,
543
+ ),
544
+ );
545
+ }
546
+
547
+ /** @internal */
548
+ export type Llm$Outbound = {
549
+ guardrail_config?: any | undefined;
550
+ output_type?: string | undefined;
551
+ type: string;
552
+ repetitions?: number | null | undefined;
553
+ prompt: string;
554
+ categories?: Array<string> | null | undefined;
555
+ categorical_labels?:
556
+ | Array<CreateEval1CategoricalLabels$Outbound>
557
+ | null
558
+ | undefined;
559
+ dataset_id?: string | null | undefined;
560
+ path?: string | undefined;
561
+ project_id?: string | undefined;
562
+ description: string;
563
+ key: string;
564
+ mode: "single";
565
+ model: string;
566
+ };
567
+
568
+ /** @internal */
569
+ export const Llm$outboundSchema: z.ZodType<Llm$Outbound, z.ZodTypeDef, Llm> = z
570
+ .object({
571
+ guardrailConfig: z.any().optional(),
572
+ outputType: CreateEval1OutputType$outboundSchema.optional(),
573
+ type: OneType$outboundSchema,
574
+ repetitions: z.nullable(z.number().int()).optional(),
575
+ prompt: z.string(),
576
+ categories: z.nullable(z.array(z.string())).optional(),
577
+ categoricalLabels: z.nullable(
578
+ z.array(z.lazy(() => CreateEval1CategoricalLabels$outboundSchema)),
579
+ ).optional(),
580
+ datasetId: z.nullable(z.string()).optional(),
581
+ path: z.string().optional(),
582
+ projectId: z.string().optional(),
583
+ description: z.string().default(""),
584
+ key: z.string(),
585
+ mode: z.literal("single"),
586
+ model: z.string(),
587
+ }).transform((v) => {
588
+ return remap$(v, {
589
+ guardrailConfig: "guardrail_config",
590
+ outputType: "output_type",
591
+ categoricalLabels: "categorical_labels",
592
+ datasetId: "dataset_id",
593
+ projectId: "project_id",
594
+ });
595
+ });
596
+
597
+ export function llmToJSON(llm: Llm): string {
598
+ return JSON.stringify(Llm$outboundSchema.parse(llm));
599
+ }
600
+
601
+ /** @internal */
602
+ export type CreateEvalRequestBody1$Outbound = Llm$Outbound | LLMJury$Outbound;
603
+
604
+ /** @internal */
605
+ export const CreateEvalRequestBody1$outboundSchema: z.ZodType<
606
+ CreateEvalRequestBody1$Outbound,
607
+ z.ZodTypeDef,
608
+ CreateEvalRequestBody1
609
+ > = z.union([
610
+ z.lazy(() => Llm$outboundSchema),
611
+ z.lazy(() => LLMJury$outboundSchema),
612
+ ]);
613
+
614
+ export function createEvalRequestBody1ToJSON(
615
+ createEvalRequestBody1: CreateEvalRequestBody1,
616
+ ): string {
617
+ return JSON.stringify(
618
+ CreateEvalRequestBody1$outboundSchema.parse(createEvalRequestBody1),
619
+ );
620
+ }
16
621
 
17
622
  /** @internal */
18
- export type CreateEvalRequestBody$Outbound = {};
623
+ export type CreateEvalRequestBody$Outbound =
624
+ | Python$Outbound
625
+ | Llm$Outbound
626
+ | LLMJury$Outbound;
19
627
 
20
628
  /** @internal */
21
629
  export const CreateEvalRequestBody$outboundSchema: z.ZodType<
22
630
  CreateEvalRequestBody$Outbound,
23
631
  z.ZodTypeDef,
24
632
  CreateEvalRequestBody
25
- > = z.object({});
633
+ > = z.union([
634
+ z.lazy(() => Python$outboundSchema),
635
+ z.union([
636
+ z.lazy(() => Llm$outboundSchema),
637
+ z.lazy(() => LLMJury$outboundSchema),
638
+ ]),
639
+ ]);
26
640
 
27
641
  export function createEvalRequestBodyToJSON(
28
642
  createEvalRequestBody: CreateEvalRequestBody,
@@ -37,7 +651,15 @@ export const CreateEvalResponseBody$inboundSchema: z.ZodType<
37
651
  CreateEvalResponseBody,
38
652
  z.ZodTypeDef,
39
653
  unknown
40
- > = z.object({});
654
+ > = z.union([
655
+ components.EvaluatorResponseLlm$inboundSchema,
656
+ components.EvaluatorResponseJsonSchema$inboundSchema,
657
+ components.EvaluatorResponseHttp$inboundSchema,
658
+ components.EvaluatorResponsePython$inboundSchema,
659
+ components.EvaluatorResponseFunction$inboundSchema,
660
+ components.EvaluatorResponseRagas$inboundSchema,
661
+ components.EvaluatorResponseTypescript$inboundSchema,
662
+ ]);
41
663
 
42
664
  export function createEvalResponseBodyFromJSON(
43
665
  jsonString: string,