@orq-ai/node 4.11.0-rc.52 → 4.11.0-rc.54

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 (294) hide show
  1. package/funcs/knowledgeList.js +1 -0
  2. package/funcs/knowledgeList.js.map +1 -1
  3. package/funcs/memoryStoresList.js +1 -0
  4. package/funcs/memoryStoresList.js.map +1 -1
  5. package/jsr.json +1 -1
  6. package/lib/config.d.ts +2 -2
  7. package/lib/config.js +2 -2
  8. package/models/components/createskillrequest.d.ts +6 -6
  9. package/models/components/createskillrequest.d.ts.map +1 -1
  10. package/models/components/createskillrequest.js +6 -7
  11. package/models/components/createskillrequest.js.map +1 -1
  12. package/models/components/evaluatorresponsefunction.d.ts +270 -0
  13. package/models/components/evaluatorresponsefunction.d.ts.map +1 -0
  14. package/models/components/evaluatorresponsefunction.js +491 -0
  15. package/models/components/evaluatorresponsefunction.js.map +1 -0
  16. package/models/components/evaluatorresponsehttp.d.ts +76 -0
  17. package/models/components/evaluatorresponsehttp.d.ts.map +1 -0
  18. package/models/components/evaluatorresponsehttp.js +146 -0
  19. package/models/components/evaluatorresponsehttp.js.map +1 -0
  20. package/models/components/evaluatorresponsejsonschema.d.ts +62 -0
  21. package/models/components/evaluatorresponsejsonschema.d.ts.map +1 -0
  22. package/models/components/evaluatorresponsejsonschema.js +135 -0
  23. package/models/components/evaluatorresponsejsonschema.js.map +1 -0
  24. package/models/components/evaluatorresponsellm.d.ts +140 -0
  25. package/models/components/evaluatorresponsellm.d.ts.map +1 -0
  26. package/models/components/evaluatorresponsellm.js +250 -0
  27. package/models/components/evaluatorresponsellm.js.map +1 -0
  28. package/models/components/evaluatorresponsepython.d.ts +62 -0
  29. package/models/components/evaluatorresponsepython.d.ts.map +1 -0
  30. package/models/components/evaluatorresponsepython.js +136 -0
  31. package/models/components/evaluatorresponsepython.js.map +1 -0
  32. package/models/components/evaluatorresponseragas.d.ts +80 -0
  33. package/models/components/evaluatorresponseragas.d.ts.map +1 -0
  34. package/models/components/evaluatorresponseragas.js +155 -0
  35. package/models/components/evaluatorresponseragas.js.map +1 -0
  36. package/models/components/evaluatorresponsetypescript.d.ts +62 -0
  37. package/models/components/evaluatorresponsetypescript.d.ts.map +1 -0
  38. package/models/components/evaluatorresponsetypescript.js +136 -0
  39. package/models/components/evaluatorresponsetypescript.js.map +1 -0
  40. package/models/components/guardrailrule.d.ts +2 -0
  41. package/models/components/guardrailrule.d.ts.map +1 -1
  42. package/models/components/guardrailrule.js +2 -0
  43. package/models/components/guardrailrule.js.map +1 -1
  44. package/models/components/index.d.ts +13 -0
  45. package/models/components/index.d.ts.map +1 -1
  46. package/models/components/index.js +13 -0
  47. package/models/components/index.js.map +1 -1
  48. package/models/components/invokedeploymentrequest.d.ts +36 -36
  49. package/models/components/invokedeploymentrequest.d.ts.map +1 -1
  50. package/models/components/invokedeploymentrequest.js +33 -34
  51. package/models/components/invokedeploymentrequest.js.map +1 -1
  52. package/models/components/modelsconfig.d.ts +5 -5
  53. package/models/components/modelsconfig.d.ts.map +1 -1
  54. package/models/components/modelsconfig.js +6 -6
  55. package/models/components/modelsconfig.js.map +1 -1
  56. package/models/components/piiredactionplugin.d.ts +14 -0
  57. package/models/components/piiredactionplugin.d.ts.map +1 -0
  58. package/models/components/piiredactionplugin.js +59 -0
  59. package/models/components/piiredactionplugin.js.map +1 -0
  60. package/models/components/piiredactionpluginauto.d.ts +127 -0
  61. package/models/components/piiredactionpluginauto.d.ts.map +1 -0
  62. package/models/components/piiredactionpluginauto.js +157 -0
  63. package/models/components/piiredactionpluginauto.js.map +1 -0
  64. package/models/components/piiredactionpluginen.d.ts +146 -0
  65. package/models/components/piiredactionpluginen.d.ts.map +1 -0
  66. package/models/components/piiredactionpluginen.js +168 -0
  67. package/models/components/piiredactionpluginen.js.map +1 -0
  68. package/models/components/piiredactionpluginnl.d.ts +138 -0
  69. package/models/components/piiredactionpluginnl.d.ts.map +1 -0
  70. package/models/components/piiredactionpluginnl.js +159 -0
  71. package/models/components/piiredactionpluginnl.js.map +1 -0
  72. package/models/components/plugin.d.ts +11 -0
  73. package/models/components/plugin.d.ts.map +1 -0
  74. package/models/components/plugin.js +57 -0
  75. package/models/components/plugin.js.map +1 -0
  76. package/models/components/publicpiiredactionplugin.d.ts +79 -0
  77. package/models/components/publicpiiredactionplugin.d.ts.map +1 -0
  78. package/models/components/publicpiiredactionplugin.js +86 -0
  79. package/models/components/publicpiiredactionplugin.js.map +1 -0
  80. package/models/components/reasoningpart.js +1 -1
  81. package/models/components/textcontentpartschema.d.ts +10 -10
  82. package/models/components/textcontentpartschema.d.ts.map +1 -1
  83. package/models/components/textcontentpartschema.js +11 -11
  84. package/models/components/textcontentpartschema.js.map +1 -1
  85. package/models/operations/createagentrequest.d.ts +38 -0
  86. package/models/operations/createagentrequest.d.ts.map +1 -1
  87. package/models/operations/createagentrequest.js +65 -5
  88. package/models/operations/createagentrequest.js.map +1 -1
  89. package/models/operations/createchatcompletion.d.ts +11 -0
  90. package/models/operations/createchatcompletion.d.ts.map +1 -1
  91. package/models/operations/createchatcompletion.js +18 -3
  92. package/models/operations/createchatcompletion.js.map +1 -1
  93. package/models/operations/createcompletion.d.ts +11 -0
  94. package/models/operations/createcompletion.d.ts.map +1 -1
  95. package/models/operations/createcompletion.js +18 -3
  96. package/models/operations/createcompletion.js.map +1 -1
  97. package/models/operations/createdataset.js +1 -1
  98. package/models/operations/createdatasetitem.js +4 -4
  99. package/models/operations/createdatasource.js +1 -1
  100. package/models/operations/createeval.d.ts +22 -852
  101. package/models/operations/createeval.d.ts.map +1 -1
  102. package/models/operations/createeval.js +30 -1341
  103. package/models/operations/createeval.js.map +1 -1
  104. package/models/operations/createimage.d.ts +11 -0
  105. package/models/operations/createimage.d.ts.map +1 -1
  106. package/models/operations/createimage.js +16 -1
  107. package/models/operations/createimage.js.map +1 -1
  108. package/models/operations/createprompt.d.ts +27 -8
  109. package/models/operations/createprompt.d.ts.map +1 -1
  110. package/models/operations/createprompt.js +42 -12
  111. package/models/operations/createprompt.js.map +1 -1
  112. package/models/operations/creatererank.d.ts +11 -0
  113. package/models/operations/creatererank.d.ts.map +1 -1
  114. package/models/operations/creatererank.js +16 -1
  115. package/models/operations/creatererank.js.map +1 -1
  116. package/models/operations/createrouterresponse.d.ts +5 -0
  117. package/models/operations/createrouterresponse.d.ts.map +1 -1
  118. package/models/operations/createrouterresponse.js +1 -0
  119. package/models/operations/createrouterresponse.js.map +1 -1
  120. package/models/operations/createtool.d.ts +8 -8
  121. package/models/operations/createtool.d.ts.map +1 -1
  122. package/models/operations/createtool.js +16 -16
  123. package/models/operations/createtool.js.map +1 -1
  124. package/models/operations/deploymentgetconfig.d.ts +8 -8
  125. package/models/operations/deploymentgetconfig.d.ts.map +1 -1
  126. package/models/operations/deploymentgetconfig.js +10 -10
  127. package/models/operations/deploymentgetconfig.js.map +1 -1
  128. package/models/operations/getallmemorystores.d.ts +5 -0
  129. package/models/operations/getallmemorystores.d.ts.map +1 -1
  130. package/models/operations/getallmemorystores.js +2 -0
  131. package/models/operations/getallmemorystores.js.map +1 -1
  132. package/models/operations/getallprompts.d.ts +8 -0
  133. package/models/operations/getallprompts.d.ts.map +1 -1
  134. package/models/operations/getallprompts.js +16 -1
  135. package/models/operations/getallprompts.js.map +1 -1
  136. package/models/operations/getalltools.d.ts +20 -20
  137. package/models/operations/getalltools.d.ts.map +1 -1
  138. package/models/operations/getalltools.js +28 -26
  139. package/models/operations/getalltools.js.map +1 -1
  140. package/models/operations/getevals.d.ts +3 -833
  141. package/models/operations/getevals.d.ts.map +1 -1
  142. package/models/operations/getevals.js +16 -1314
  143. package/models/operations/getevals.js.map +1 -1
  144. package/models/operations/getoneprompt.d.ts +8 -0
  145. package/models/operations/getoneprompt.d.ts.map +1 -1
  146. package/models/operations/getoneprompt.js +17 -2
  147. package/models/operations/getoneprompt.js.map +1 -1
  148. package/models/operations/getpromptversion.d.ts +8 -0
  149. package/models/operations/getpromptversion.d.ts.map +1 -1
  150. package/models/operations/getpromptversion.js +17 -2
  151. package/models/operations/getpromptversion.js.map +1 -1
  152. package/models/operations/getv2humanevalsets.js +2 -2
  153. package/models/operations/getv2humanevalsetsid.js +2 -2
  154. package/models/operations/guardrailrulecreate.d.ts +1 -0
  155. package/models/operations/guardrailrulecreate.d.ts.map +1 -1
  156. package/models/operations/guardrailrulecreate.js +1 -0
  157. package/models/operations/guardrailrulecreate.js.map +1 -1
  158. package/models/operations/guardrailruleget.d.ts +1 -0
  159. package/models/operations/guardrailruleget.d.ts.map +1 -1
  160. package/models/operations/guardrailruleget.js +1 -0
  161. package/models/operations/guardrailruleget.js.map +1 -1
  162. package/models/operations/guardrailruleupdate.d.ts +1 -0
  163. package/models/operations/guardrailruleupdate.d.ts.map +1 -1
  164. package/models/operations/guardrailruleupdate.js +1 -0
  165. package/models/operations/guardrailruleupdate.js.map +1 -1
  166. package/models/operations/invokeeval.d.ts +7 -7
  167. package/models/operations/invokeeval.d.ts.map +1 -1
  168. package/models/operations/invokeeval.js +11 -11
  169. package/models/operations/invokeeval.js.map +1 -1
  170. package/models/operations/listagents.d.ts +16 -0
  171. package/models/operations/listagents.d.ts.map +1 -1
  172. package/models/operations/listagents.js +32 -2
  173. package/models/operations/listagents.js.map +1 -1
  174. package/models/operations/listdatasetdatapoints.js +4 -4
  175. package/models/operations/listdatasets.js +1 -1
  176. package/models/operations/listdatasources.js +1 -1
  177. package/models/operations/listknowledgebases.d.ts +5 -0
  178. package/models/operations/listknowledgebases.d.ts.map +1 -1
  179. package/models/operations/listknowledgebases.js +2 -0
  180. package/models/operations/listknowledgebases.js.map +1 -1
  181. package/models/operations/listpromptversions.d.ts +8 -0
  182. package/models/operations/listpromptversions.d.ts.map +1 -1
  183. package/models/operations/listpromptversions.js +17 -2
  184. package/models/operations/listpromptversions.js.map +1 -1
  185. package/models/operations/patchv2humanevalsetsid.js +2 -2
  186. package/models/operations/postv2feedbackevaluation.js +3 -3
  187. package/models/operations/postv2humanevalsets.js +2 -2
  188. package/models/operations/retrieveagentrequest.d.ts +16 -0
  189. package/models/operations/retrieveagentrequest.d.ts.map +1 -1
  190. package/models/operations/retrieveagentrequest.js +32 -2
  191. package/models/operations/retrieveagentrequest.js.map +1 -1
  192. package/models/operations/retrievedatapoint.js +4 -4
  193. package/models/operations/retrievedataset.js +1 -1
  194. package/models/operations/retrievedatasource.js +1 -1
  195. package/models/operations/retrievetool.js +6 -6
  196. package/models/operations/runagent.d.ts +22 -0
  197. package/models/operations/runagent.d.ts.map +1 -1
  198. package/models/operations/runagent.js +34 -4
  199. package/models/operations/runagent.js.map +1 -1
  200. package/models/operations/streamrunagent.d.ts +22 -0
  201. package/models/operations/streamrunagent.d.ts.map +1 -1
  202. package/models/operations/streamrunagent.js +34 -4
  203. package/models/operations/streamrunagent.js.map +1 -1
  204. package/models/operations/updateagent.d.ts +38 -0
  205. package/models/operations/updateagent.d.ts.map +1 -1
  206. package/models/operations/updateagent.js +65 -5
  207. package/models/operations/updateagent.js.map +1 -1
  208. package/models/operations/updatedatapoint.js +4 -4
  209. package/models/operations/updatedataset.js +1 -1
  210. package/models/operations/updatedatasource.js +1 -1
  211. package/models/operations/updateeval.d.ts +2 -832
  212. package/models/operations/updateeval.d.ts.map +1 -1
  213. package/models/operations/updateeval.js +9 -1304
  214. package/models/operations/updateeval.js.map +1 -1
  215. package/models/operations/updateprompt.d.ts +19 -0
  216. package/models/operations/updateprompt.d.ts.map +1 -1
  217. package/models/operations/updateprompt.js +33 -3
  218. package/models/operations/updateprompt.js.map +1 -1
  219. package/models/operations/updatetool.js +7 -7
  220. package/package.json +7 -7
  221. package/sdk/feedback.d.ts +2 -2
  222. package/sdk/feedback.js +2 -2
  223. package/src/funcs/knowledgeList.ts +1 -0
  224. package/src/funcs/memoryStoresList.ts +1 -0
  225. package/src/lib/config.ts +2 -2
  226. package/src/models/components/createskillrequest.ts +27 -20
  227. package/src/models/components/evaluatorresponsefunction.ts +1107 -0
  228. package/src/models/components/evaluatorresponsehttp.ts +247 -0
  229. package/src/models/components/evaluatorresponsejsonschema.ts +214 -0
  230. package/src/models/components/evaluatorresponsellm.ts +442 -0
  231. package/src/models/components/evaluatorresponsepython.ts +234 -0
  232. package/src/models/components/evaluatorresponseragas.ts +257 -0
  233. package/src/models/components/evaluatorresponsetypescript.ts +247 -0
  234. package/src/models/components/guardrailrule.ts +3 -0
  235. package/src/models/components/index.ts +13 -0
  236. package/src/models/components/invokedeploymentrequest.ts +119 -95
  237. package/src/models/components/modelsconfig.ts +11 -10
  238. package/src/models/components/piiredactionplugin.ts +44 -0
  239. package/src/models/components/piiredactionpluginauto.ts +186 -0
  240. package/src/models/components/piiredactionpluginen.ts +223 -0
  241. package/src/models/components/piiredactionpluginnl.ts +219 -0
  242. package/src/models/components/plugin.ts +37 -0
  243. package/src/models/components/publicpiiredactionplugin.ts +127 -0
  244. package/src/models/components/reasoningpart.ts +1 -1
  245. package/src/models/components/textcontentpartschema.ts +23 -19
  246. package/src/models/operations/createagentrequest.ts +199 -0
  247. package/src/models/operations/createchatcompletion.ts +56 -0
  248. package/src/models/operations/createcompletion.ts +54 -0
  249. package/src/models/operations/createdataset.ts +1 -1
  250. package/src/models/operations/createdatasetitem.ts +4 -4
  251. package/src/models/operations/createdatasource.ts +1 -1
  252. package/src/models/operations/createeval.ts +673 -3909
  253. package/src/models/operations/createimage.ts +54 -0
  254. package/src/models/operations/createprompt.ts +115 -22
  255. package/src/models/operations/creatererank.ts +54 -0
  256. package/src/models/operations/createrouterresponse.ts +11 -0
  257. package/src/models/operations/createtool.ts +22 -24
  258. package/src/models/operations/deploymentgetconfig.ts +16 -18
  259. package/src/models/operations/getallmemorystores.ts +7 -0
  260. package/src/models/operations/getallprompts.ts +43 -0
  261. package/src/models/operations/getalltools.ts +47 -53
  262. package/src/models/operations/getevals.ts +29 -3214
  263. package/src/models/operations/getoneprompt.ts +43 -0
  264. package/src/models/operations/getpromptversion.ts +43 -0
  265. package/src/models/operations/getv2humanevalsets.ts +2 -2
  266. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  267. package/src/models/operations/guardrailrulecreate.ts +2 -0
  268. package/src/models/operations/guardrailruleget.ts +2 -0
  269. package/src/models/operations/guardrailruleupdate.ts +2 -0
  270. package/src/models/operations/invokeeval.ts +18 -18
  271. package/src/models/operations/listagents.ts +93 -0
  272. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  273. package/src/models/operations/listdatasets.ts +1 -1
  274. package/src/models/operations/listdatasources.ts +1 -1
  275. package/src/models/operations/listknowledgebases.ts +7 -0
  276. package/src/models/operations/listpromptversions.ts +43 -0
  277. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  278. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  279. package/src/models/operations/postv2humanevalsets.ts +2 -2
  280. package/src/models/operations/retrieveagentrequest.ts +93 -0
  281. package/src/models/operations/retrievedatapoint.ts +4 -4
  282. package/src/models/operations/retrievedataset.ts +1 -1
  283. package/src/models/operations/retrievedatasource.ts +1 -1
  284. package/src/models/operations/retrievetool.ts +6 -6
  285. package/src/models/operations/runagent.ts +115 -1
  286. package/src/models/operations/streamrunagent.ts +116 -1
  287. package/src/models/operations/updateagent.ts +205 -0
  288. package/src/models/operations/updatedatapoint.ts +4 -4
  289. package/src/models/operations/updatedataset.ts +1 -1
  290. package/src/models/operations/updatedatasource.ts +1 -1
  291. package/src/models/operations/updateeval.ts +306 -3524
  292. package/src/models/operations/updateprompt.ts +97 -0
  293. package/src/models/operations/updatetool.ts +7 -7
  294. package/src/sdk/feedback.ts +2 -2
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { ClosedEnum } from "../../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import * as components from "../components/index.js";
10
11
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
12
 
12
13
  export const GuardrailConfigOperator = {
@@ -83,7 +84,7 @@ export type Python = {
83
84
  key: string;
84
85
  };
85
86
 
86
- export const CreateEvalGuardrailConfigEvalsRequestOperator = {
87
+ export const CreateEvalGuardrailConfigEvalsOperator = {
87
88
  Eq: "eq",
88
89
  Ne: "ne",
89
90
  Gt: "gt",
@@ -91,26 +92,26 @@ export const CreateEvalGuardrailConfigEvalsRequestOperator = {
91
92
  Lt: "lt",
92
93
  Lte: "lte",
93
94
  } as const;
94
- export type CreateEvalGuardrailConfigEvalsRequestOperator = ClosedEnum<
95
- typeof CreateEvalGuardrailConfigEvalsRequestOperator
95
+ export type CreateEvalGuardrailConfigEvalsOperator = ClosedEnum<
96
+ typeof CreateEvalGuardrailConfigEvalsOperator
96
97
  >;
97
98
 
98
- export type CreateEvalGuardrailConfigEvalsRequestNumber = {
99
+ export type CreateEvalGuardrailConfigEvalsNumber = {
99
100
  enabled?: boolean | undefined;
100
101
  alertOnFailure?: boolean | undefined;
101
102
  type: "number";
102
103
  value: number;
103
- operator: CreateEvalGuardrailConfigEvalsRequestOperator;
104
+ operator: CreateEvalGuardrailConfigEvalsOperator;
104
105
  };
105
106
 
106
- export type CreateEvalGuardrailConfigEvalsRequestCategorical = {
107
+ export type CreateEvalGuardrailConfigEvalsCategorical = {
107
108
  enabled?: boolean | undefined;
108
109
  alertOnFailure?: boolean | undefined;
109
110
  type: "categorical";
110
111
  values: Array<string>;
111
112
  };
112
113
 
113
- export type CreateEvalGuardrailConfigEvalsRequestBoolean = {
114
+ export type CreateEvalGuardrailConfigEvalsBoolean = {
114
115
  enabled?: boolean | undefined;
115
116
  alertOnFailure?: boolean | undefined;
116
117
  type: "boolean";
@@ -118,9 +119,9 @@ export type CreateEvalGuardrailConfigEvalsRequestBoolean = {
118
119
  };
119
120
 
120
121
  export type LLMGuardrailConfig =
121
- | CreateEvalGuardrailConfigEvalsRequestBoolean
122
- | CreateEvalGuardrailConfigEvalsRequestCategorical
123
- | CreateEvalGuardrailConfigEvalsRequestNumber;
122
+ | CreateEvalGuardrailConfigEvalsBoolean
123
+ | CreateEvalGuardrailConfigEvalsCategorical
124
+ | CreateEvalGuardrailConfigEvalsNumber;
124
125
 
125
126
  /**
126
127
  * The type of output expected from the evaluator
@@ -190,9 +191,9 @@ export type LLMJury = {
190
191
 
191
192
  export type Llm2 = {
192
193
  guardrailConfig?:
193
- | CreateEvalGuardrailConfigEvalsRequestBoolean
194
- | CreateEvalGuardrailConfigEvalsRequestCategorical
195
- | CreateEvalGuardrailConfigEvalsRequestNumber
194
+ | CreateEvalGuardrailConfigEvalsBoolean
195
+ | CreateEvalGuardrailConfigEvalsCategorical
196
+ | CreateEvalGuardrailConfigEvalsNumber
196
197
  | null
197
198
  | undefined;
198
199
  /**
@@ -323,4112 +324,878 @@ export type Llm = Llm1 | Llm2;
323
324
 
324
325
  export type CreateEvalRequestBody = Python | Llm1 | Llm2;
325
326
 
326
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Operator =
327
- {
328
- Eq: "eq",
329
- Ne: "ne",
330
- Gt: "gt",
331
- Gte: "gte",
332
- Lt: "lt",
333
- Lte: "lte",
334
- } as const;
335
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Operator =
336
- ClosedEnum<
337
- typeof CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Operator
338
- >;
339
-
340
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Number =
341
- {
342
- enabled: boolean;
343
- alertOnFailure: boolean;
344
- type: "number";
345
- value: number;
346
- operator:
347
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Operator;
348
- };
349
-
350
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Categorical =
351
- {
352
- enabled: boolean;
353
- alertOnFailure: boolean;
354
- type: "categorical";
355
- values: Array<string>;
356
- };
357
-
358
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Boolean =
359
- {
360
- enabled: boolean;
361
- alertOnFailure: boolean;
362
- type: "boolean";
363
- value: boolean;
364
- };
365
-
366
- export type CreateEvalResponseBodyEvalsResponse200ApplicationJSONGuardrailConfig =
367
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Boolean
368
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Categorical
369
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Number;
370
-
371
- export const CreateEvalResponseBodyEvalsResponse200ApplicationJSONType = {
372
- TypescriptEval: "typescript_eval",
373
- } as const;
374
- export type CreateEvalResponseBodyEvalsResponse200ApplicationJSONType =
375
- ClosedEnum<typeof CreateEvalResponseBodyEvalsResponse200ApplicationJSONType>;
376
-
377
- export type Typescript = {
378
- id: string;
379
- description: string;
380
- created: string;
381
- updated: string;
382
- updatedById?: string | null | undefined;
383
- guardrailConfig?:
384
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Boolean
385
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Categorical
386
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Number
387
- | null
388
- | undefined;
389
- code: string;
390
- type: CreateEvalResponseBodyEvalsResponse200ApplicationJSONType;
391
- key: string;
392
- };
393
-
394
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyOperator =
395
- {
396
- Eq: "eq",
397
- Ne: "ne",
398
- Gt: "gt",
399
- Gte: "gte",
400
- Lt: "lt",
401
- Lte: "lte",
402
- } as const;
403
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyOperator =
404
- ClosedEnum<
405
- typeof CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyOperator
406
- >;
407
-
408
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber =
409
- {
410
- enabled: boolean;
411
- alertOnFailure: boolean;
412
- type: "number";
413
- value: number;
414
- operator:
415
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyOperator;
416
- };
417
-
418
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyCategorical =
419
- {
420
- enabled: boolean;
421
- alertOnFailure: boolean;
422
- type: "categorical";
423
- values: Array<string>;
424
- };
425
-
426
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyBoolean =
427
- {
428
- enabled: boolean;
429
- alertOnFailure: boolean;
430
- type: "boolean";
431
- value: boolean;
432
- };
433
-
434
- export type CreateEvalResponseBodyEvalsResponse200GuardrailConfig =
435
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyBoolean
436
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyCategorical
437
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber;
438
-
439
- export const CreateEvalResponseBodyEvalsResponse200Type = {
440
- Ragas: "ragas",
441
- } as const;
442
- export type CreateEvalResponseBodyEvalsResponse200Type = ClosedEnum<
443
- typeof CreateEvalResponseBodyEvalsResponse200Type
444
- >;
445
-
446
- export const RagasMetric = {
447
- ContextPrecision: "context_precision",
448
- ContextRecall: "context_recall",
449
- ContextEntitiesRecall: "context_entities_recall",
450
- Harmfulness: "harmfulness",
451
- Maliciousness: "maliciousness",
452
- Coherence: "coherence",
453
- Correctness: "correctness",
454
- Conciseness: "conciseness",
455
- ResponseRelevancy: "response_relevancy",
456
- Faithfulness: "faithfulness",
457
- Summarization: "summarization",
458
- NoiseSensitivity: "noise_sensitivity",
459
- } as const;
460
- export type RagasMetric = ClosedEnum<typeof RagasMetric>;
327
+ /**
328
+ * Successfully created an evaluator
329
+ */
330
+ export type CreateEvalResponseBody =
331
+ | components.EvaluatorResponseLlm
332
+ | components.EvaluatorResponseJsonSchema
333
+ | components.EvaluatorResponseHttp
334
+ | components.EvaluatorResponsePython
335
+ | components.EvaluatorResponseFunction
336
+ | components.EvaluatorResponseRagas
337
+ | components.EvaluatorResponseTypescript;
461
338
 
462
- export type Ragas = {
463
- id: string;
464
- description: string;
465
- created: string;
466
- updated: string;
467
- updatedById?: string | null | undefined;
468
- guardrailConfig?:
469
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyBoolean
470
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyCategorical
471
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber
472
- | null
473
- | undefined;
474
- type: CreateEvalResponseBodyEvalsResponse200Type;
475
- ragasMetric: RagasMetric;
476
- key: string;
477
- model: string;
478
- };
339
+ /** @internal */
340
+ export const GuardrailConfigOperator$outboundSchema: z.ZodNativeEnum<
341
+ typeof GuardrailConfigOperator
342
+ > = z.nativeEnum(GuardrailConfigOperator);
479
343
 
480
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONOperator =
481
- {
482
- Eq: "eq",
483
- Ne: "ne",
484
- Gt: "gt",
485
- Gte: "gte",
486
- Lt: "lt",
487
- Lte: "lte",
488
- } as const;
489
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONOperator =
490
- ClosedEnum<
491
- typeof CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONOperator
492
- >;
493
-
494
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber = {
344
+ /** @internal */
345
+ export type GuardrailConfigNumber$Outbound = {
495
346
  enabled: boolean;
496
- alertOnFailure: boolean;
347
+ alert_on_failure: boolean;
497
348
  type: "number";
498
349
  value: number;
499
- operator: CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONOperator;
500
- };
501
-
502
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONCategorical =
503
- {
504
- enabled: boolean;
505
- alertOnFailure: boolean;
506
- type: "categorical";
507
- values: Array<string>;
508
- };
509
-
510
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONBoolean = {
511
- enabled: boolean;
512
- alertOnFailure: boolean;
513
- type: "boolean";
514
- value: boolean;
350
+ operator: string;
515
351
  };
516
352
 
517
- export type CreateEvalResponseBodyEvalsResponseGuardrailConfig =
518
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONBoolean
519
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONCategorical
520
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber;
521
-
522
- export const CreateEvalResponseBodyEvalsResponseType = {
523
- FunctionEval: "function_eval",
524
- } as const;
525
- export type CreateEvalResponseBodyEvalsResponseType = ClosedEnum<
526
- typeof CreateEvalResponseBodyEvalsResponseType
527
- >;
528
-
529
- export type ThirtyTwo = {
530
- type: "grammar_diversity";
531
- };
353
+ /** @internal */
354
+ export const GuardrailConfigNumber$outboundSchema: z.ZodType<
355
+ GuardrailConfigNumber$Outbound,
356
+ z.ZodTypeDef,
357
+ GuardrailConfigNumber
358
+ > = z.object({
359
+ enabled: z.boolean().default(true),
360
+ alertOnFailure: z.boolean().default(false),
361
+ type: z.literal("number"),
362
+ value: z.number(),
363
+ operator: GuardrailConfigOperator$outboundSchema,
364
+ }).transform((v) => {
365
+ return remap$(v, {
366
+ alertOnFailure: "alert_on_failure",
367
+ });
368
+ });
532
369
 
533
- export type ThirtyOne = {
534
- type: "lexical_repetition";
535
- };
370
+ export function guardrailConfigNumberToJSON(
371
+ guardrailConfigNumber: GuardrailConfigNumber,
372
+ ): string {
373
+ return JSON.stringify(
374
+ GuardrailConfigNumber$outboundSchema.parse(guardrailConfigNumber),
375
+ );
376
+ }
536
377
 
537
- export type Thirty = {
538
- type: "sentences_count";
378
+ /** @internal */
379
+ export type GuardrailConfigCategorical$Outbound = {
380
+ enabled: boolean;
381
+ alert_on_failure: boolean;
382
+ type: "categorical";
383
+ values: Array<string>;
539
384
  };
540
385
 
541
- export type TwentyNine = {
542
- type: "words_count";
543
- };
386
+ /** @internal */
387
+ export const GuardrailConfigCategorical$outboundSchema: z.ZodType<
388
+ GuardrailConfigCategorical$Outbound,
389
+ z.ZodTypeDef,
390
+ GuardrailConfigCategorical
391
+ > = z.object({
392
+ enabled: z.boolean().default(true),
393
+ alertOnFailure: z.boolean().default(false),
394
+ type: z.literal("categorical"),
395
+ values: z.array(z.string()),
396
+ }).transform((v) => {
397
+ return remap$(v, {
398
+ alertOnFailure: "alert_on_failure",
399
+ });
400
+ });
544
401
 
545
- export type TwentyEight = {
546
- type: "gse_english_level";
547
- };
402
+ export function guardrailConfigCategoricalToJSON(
403
+ guardrailConfigCategorical: GuardrailConfigCategorical,
404
+ ): string {
405
+ return JSON.stringify(
406
+ GuardrailConfigCategorical$outboundSchema.parse(guardrailConfigCategorical),
407
+ );
408
+ }
548
409
 
549
- export type TwentySeven = {
550
- type: "flesch_reading_ease";
410
+ /** @internal */
411
+ export type GuardrailConfigBoolean$Outbound = {
412
+ enabled: boolean;
413
+ alert_on_failure: boolean;
414
+ type: "boolean";
415
+ value: boolean;
551
416
  };
552
417
 
553
- export type TwentySix = {
554
- type: "most_repeated_words";
555
- };
418
+ /** @internal */
419
+ export const GuardrailConfigBoolean$outboundSchema: z.ZodType<
420
+ GuardrailConfigBoolean$Outbound,
421
+ z.ZodTypeDef,
422
+ GuardrailConfigBoolean
423
+ > = z.object({
424
+ enabled: z.boolean().default(true),
425
+ alertOnFailure: z.boolean().default(false),
426
+ type: z.literal("boolean"),
427
+ value: z.boolean(),
428
+ }).transform((v) => {
429
+ return remap$(v, {
430
+ alertOnFailure: "alert_on_failure",
431
+ });
432
+ });
556
433
 
557
- export type TwentyFive = {
558
- type: "keywords_match";
559
- keywords: Array<string>;
560
- };
434
+ export function guardrailConfigBooleanToJSON(
435
+ guardrailConfigBoolean: GuardrailConfigBoolean,
436
+ ): string {
437
+ return JSON.stringify(
438
+ GuardrailConfigBoolean$outboundSchema.parse(guardrailConfigBoolean),
439
+ );
440
+ }
561
441
 
562
- export type TwentyFour = {
563
- type: "levenshtein_distance";
564
- };
442
+ /** @internal */
443
+ export type RequestBodyGuardrailConfig$Outbound =
444
+ | GuardrailConfigBoolean$Outbound
445
+ | GuardrailConfigCategorical$Outbound
446
+ | GuardrailConfigNumber$Outbound;
565
447
 
566
- export type TwentyThree = {
567
- type: "cosine_similarity";
568
- };
448
+ /** @internal */
449
+ export const RequestBodyGuardrailConfig$outboundSchema: z.ZodType<
450
+ RequestBodyGuardrailConfig$Outbound,
451
+ z.ZodTypeDef,
452
+ RequestBodyGuardrailConfig
453
+ > = z.union([
454
+ z.lazy(() => GuardrailConfigBoolean$outboundSchema),
455
+ z.lazy(() => GuardrailConfigCategorical$outboundSchema),
456
+ z.lazy(() => GuardrailConfigNumber$outboundSchema),
457
+ ]);
569
458
 
570
- export type TwentyTwo = {
571
- type: "meteor_score";
572
- };
459
+ export function requestBodyGuardrailConfigToJSON(
460
+ requestBodyGuardrailConfig: RequestBodyGuardrailConfig,
461
+ ): string {
462
+ return JSON.stringify(
463
+ RequestBodyGuardrailConfig$outboundSchema.parse(requestBodyGuardrailConfig),
464
+ );
465
+ }
573
466
 
574
- export type TwentyOne = {
575
- type: "rouge_n";
576
- };
467
+ /** @internal */
468
+ export const OutputType$outboundSchema: z.ZodNativeEnum<typeof OutputType> = z
469
+ .nativeEnum(OutputType);
577
470
 
578
- export type Twenty = {
579
- type: "bleu_score";
580
- };
471
+ /** @internal */
472
+ export const RequestBodyType$outboundSchema: z.ZodNativeEnum<
473
+ typeof RequestBodyType
474
+ > = z.nativeEnum(RequestBodyType);
581
475
 
582
- export type Nineteen = {
583
- type: "bert_score";
476
+ /** @internal */
477
+ export type Python$Outbound = {
478
+ guardrail_config?:
479
+ | GuardrailConfigBoolean$Outbound
480
+ | GuardrailConfigCategorical$Outbound
481
+ | GuardrailConfigNumber$Outbound
482
+ | null
483
+ | undefined;
484
+ output_type?: string | undefined;
485
+ code: string;
486
+ type: string;
487
+ path: string;
488
+ description: string;
489
+ key: string;
584
490
  };
585
491
 
586
- export type Eighteen = {
587
- type: "moderations_google";
588
- };
492
+ /** @internal */
493
+ export const Python$outboundSchema: z.ZodType<
494
+ Python$Outbound,
495
+ z.ZodTypeDef,
496
+ Python
497
+ > = z.object({
498
+ guardrailConfig: z.nullable(
499
+ z.union([
500
+ z.lazy(() => GuardrailConfigBoolean$outboundSchema),
501
+ z.lazy(() => GuardrailConfigCategorical$outboundSchema),
502
+ z.lazy(() => GuardrailConfigNumber$outboundSchema),
503
+ ]),
504
+ ).optional(),
505
+ outputType: OutputType$outboundSchema.optional(),
506
+ code: z.string(),
507
+ type: RequestBodyType$outboundSchema,
508
+ path: z.string(),
509
+ description: z.string().default(""),
510
+ key: z.string(),
511
+ }).transform((v) => {
512
+ return remap$(v, {
513
+ guardrailConfig: "guardrail_config",
514
+ outputType: "output_type",
515
+ });
516
+ });
589
517
 
590
- export type Seventeen = {
591
- type: "moderations_openai";
592
- };
518
+ export function pythonToJSON(python: Python): string {
519
+ return JSON.stringify(Python$outboundSchema.parse(python));
520
+ }
593
521
 
594
- export type Sixteen = {
595
- type: "is_valid_json";
596
- };
522
+ /** @internal */
523
+ export const CreateEvalGuardrailConfigEvalsOperator$outboundSchema:
524
+ z.ZodNativeEnum<typeof CreateEvalGuardrailConfigEvalsOperator> = z.nativeEnum(
525
+ CreateEvalGuardrailConfigEvalsOperator,
526
+ );
597
527
 
598
- export type Fifteen = {
599
- type: "regex";
600
- pattern: string;
528
+ /** @internal */
529
+ export type CreateEvalGuardrailConfigEvalsNumber$Outbound = {
530
+ enabled: boolean;
531
+ alert_on_failure: boolean;
532
+ type: "number";
533
+ value: number;
534
+ operator: string;
601
535
  };
602
536
 
603
- export type Fourteen = {
604
- type: "one_line";
605
- };
537
+ /** @internal */
538
+ export const CreateEvalGuardrailConfigEvalsNumber$outboundSchema: z.ZodType<
539
+ CreateEvalGuardrailConfigEvalsNumber$Outbound,
540
+ z.ZodTypeDef,
541
+ CreateEvalGuardrailConfigEvalsNumber
542
+ > = z.object({
543
+ enabled: z.boolean().default(true),
544
+ alertOnFailure: z.boolean().default(false),
545
+ type: z.literal("number"),
546
+ value: z.number(),
547
+ operator: CreateEvalGuardrailConfigEvalsOperator$outboundSchema,
548
+ }).transform((v) => {
549
+ return remap$(v, {
550
+ alertOnFailure: "alert_on_failure",
551
+ });
552
+ });
606
553
 
607
- export type Thirteen = {
608
- type: "length_greater_than";
609
- value: number;
610
- };
554
+ export function createEvalGuardrailConfigEvalsNumberToJSON(
555
+ createEvalGuardrailConfigEvalsNumber: CreateEvalGuardrailConfigEvalsNumber,
556
+ ): string {
557
+ return JSON.stringify(
558
+ CreateEvalGuardrailConfigEvalsNumber$outboundSchema.parse(
559
+ createEvalGuardrailConfigEvalsNumber,
560
+ ),
561
+ );
562
+ }
611
563
 
612
- export type Twelve = {
613
- type: "length_between";
614
- min: number;
615
- max: number;
564
+ /** @internal */
565
+ export type CreateEvalGuardrailConfigEvalsCategorical$Outbound = {
566
+ enabled: boolean;
567
+ alert_on_failure: boolean;
568
+ type: "categorical";
569
+ values: Array<string>;
616
570
  };
617
571
 
618
- export type Eleven = {
619
- type: "length_less_than";
620
- value: number;
621
- };
622
-
623
- export type Ten = {
624
- type: "exact_match";
625
- };
626
-
627
- export type Nine = {
628
- type: "ends_with";
629
- value: string;
630
- };
631
-
632
- export type Eight = {
633
- type: "start_with";
634
- value: string;
635
- };
636
-
637
- export type Seven = {
638
- type: "contains_valid_link";
639
- };
640
-
641
- export type Six = {
642
- type: "contains_url";
643
- };
644
-
645
- export type Five = {
646
- type: "contains_email";
647
- };
648
-
649
- export type CreateEvalFunctionParams4 = {
650
- type: "contains_any";
651
- keywords: Array<string>;
652
- };
653
-
654
- export type CreateEvalFunctionParams3 = {
655
- type: "contains_all";
656
- keywords: Array<string>;
657
- };
658
-
659
- export type FunctionParams2 = {
660
- type: "contains_none";
661
- keywords: Array<string>;
662
- };
663
-
664
- export type FunctionParams1 = {
665
- type: "contains";
666
- value: string;
667
- };
668
-
669
- export type FunctionParams =
670
- | FunctionParams1
671
- | FunctionParams2
672
- | CreateEvalFunctionParams3
673
- | CreateEvalFunctionParams4
674
- | Five
675
- | Six
676
- | Seven
677
- | Eight
678
- | Nine
679
- | Ten
680
- | Eleven
681
- | Twelve
682
- | Thirteen
683
- | Fourteen
684
- | Fifteen
685
- | Sixteen
686
- | Seventeen
687
- | Eighteen
688
- | Nineteen
689
- | Twenty
690
- | TwentyOne
691
- | TwentyTwo
692
- | TwentyThree
693
- | TwentyFour
694
- | TwentyFive
695
- | TwentySix
696
- | TwentySeven
697
- | TwentyEight
698
- | TwentyNine
699
- | Thirty
700
- | ThirtyOne
701
- | ThirtyTwo;
702
-
703
- export type CreateEvalResponseBodyFunction = {
704
- id: string;
705
- description: string;
706
- created: string;
707
- updated: string;
708
- updatedById?: string | null | undefined;
709
- guardrailConfig?:
710
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONBoolean
711
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONCategorical
712
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber
713
- | null
714
- | undefined;
715
- type: CreateEvalResponseBodyEvalsResponseType;
716
- functionParams:
717
- | FunctionParams1
718
- | FunctionParams2
719
- | CreateEvalFunctionParams3
720
- | CreateEvalFunctionParams4
721
- | Five
722
- | Six
723
- | Seven
724
- | Eight
725
- | Nine
726
- | Ten
727
- | Eleven
728
- | Twelve
729
- | Thirteen
730
- | Fourteen
731
- | Fifteen
732
- | Sixteen
733
- | Seventeen
734
- | Eighteen
735
- | Nineteen
736
- | Twenty
737
- | TwentyOne
738
- | TwentyTwo
739
- | TwentyThree
740
- | TwentyFour
741
- | TwentyFive
742
- | TwentySix
743
- | TwentySeven
744
- | TwentyEight
745
- | TwentyNine
746
- | Thirty
747
- | ThirtyOne
748
- | ThirtyTwo;
749
- key: string;
750
- };
751
-
752
- export const CreateEvalGuardrailConfigEvalsResponse200Operator = {
753
- Eq: "eq",
754
- Ne: "ne",
755
- Gt: "gt",
756
- Gte: "gte",
757
- Lt: "lt",
758
- Lte: "lte",
759
- } as const;
760
- export type CreateEvalGuardrailConfigEvalsResponse200Operator = ClosedEnum<
761
- typeof CreateEvalGuardrailConfigEvalsResponse200Operator
762
- >;
763
-
764
- export type CreateEvalGuardrailConfigEvalsResponse200Number = {
765
- enabled: boolean;
766
- alertOnFailure: boolean;
767
- type: "number";
768
- value: number;
769
- operator: CreateEvalGuardrailConfigEvalsResponse200Operator;
770
- };
771
-
772
- export type CreateEvalGuardrailConfigEvalsResponse200Categorical = {
773
- enabled: boolean;
774
- alertOnFailure: boolean;
775
- type: "categorical";
776
- values: Array<string>;
777
- };
778
-
779
- export type CreateEvalGuardrailConfigEvalsResponse200Boolean = {
780
- enabled: boolean;
781
- alertOnFailure: boolean;
782
- type: "boolean";
783
- value: boolean;
784
- };
785
-
786
- export type CreateEvalResponseBodyEvalsGuardrailConfig =
787
- | CreateEvalGuardrailConfigEvalsResponse200Boolean
788
- | CreateEvalGuardrailConfigEvalsResponse200Categorical
789
- | CreateEvalGuardrailConfigEvalsResponse200Number;
790
-
791
- export const CreateEvalResponseBodyEvalsType = {
792
- PythonEval: "python_eval",
793
- } as const;
794
- export type CreateEvalResponseBodyEvalsType = ClosedEnum<
795
- typeof CreateEvalResponseBodyEvalsType
796
- >;
797
-
798
- export type ResponseBodyPython = {
799
- id: string;
800
- description: string;
801
- created: string;
802
- updated: string;
803
- updatedById?: string | null | undefined;
804
- guardrailConfig?:
805
- | CreateEvalGuardrailConfigEvalsResponse200Boolean
806
- | CreateEvalGuardrailConfigEvalsResponse200Categorical
807
- | CreateEvalGuardrailConfigEvalsResponse200Number
808
- | null
809
- | undefined;
810
- code: string;
811
- type: CreateEvalResponseBodyEvalsType;
812
- key: string;
813
- };
814
-
815
- export const CreateEvalGuardrailConfigEvalsResponseOperator = {
816
- Eq: "eq",
817
- Ne: "ne",
818
- Gt: "gt",
819
- Gte: "gte",
820
- Lt: "lt",
821
- Lte: "lte",
822
- } as const;
823
- export type CreateEvalGuardrailConfigEvalsResponseOperator = ClosedEnum<
824
- typeof CreateEvalGuardrailConfigEvalsResponseOperator
825
- >;
826
-
827
- export type CreateEvalGuardrailConfigEvalsResponseNumber = {
828
- enabled: boolean;
829
- alertOnFailure: boolean;
830
- type: "number";
831
- value: number;
832
- operator: CreateEvalGuardrailConfigEvalsResponseOperator;
833
- };
834
-
835
- export type CreateEvalGuardrailConfigEvalsResponseCategorical = {
836
- enabled: boolean;
837
- alertOnFailure: boolean;
838
- type: "categorical";
839
- values: Array<string>;
840
- };
841
-
842
- export type CreateEvalGuardrailConfigEvalsResponseBoolean = {
843
- enabled: boolean;
844
- alertOnFailure: boolean;
845
- type: "boolean";
846
- value: boolean;
847
- };
848
-
849
- export type CreateEvalResponseBodyGuardrailConfig =
850
- | CreateEvalGuardrailConfigEvalsResponseBoolean
851
- | CreateEvalGuardrailConfigEvalsResponseCategorical
852
- | CreateEvalGuardrailConfigEvalsResponseNumber;
853
-
854
- export const CreateEvalResponseBodyType = {
855
- HttpEval: "http_eval",
856
- } as const;
857
- export type CreateEvalResponseBodyType = ClosedEnum<
858
- typeof CreateEvalResponseBodyType
859
- >;
860
-
861
- export const CreateEvalResponseBodyMethod = {
862
- Get: "GET",
863
- Post: "POST",
864
- } as const;
865
- export type CreateEvalResponseBodyMethod = ClosedEnum<
866
- typeof CreateEvalResponseBodyMethod
867
- >;
868
-
869
- export type CreateEvalResponseBodyHTTP = {
870
- id: string;
871
- description: string;
872
- created: string;
873
- updated: string;
874
- updatedById?: string | null | undefined;
875
- guardrailConfig?:
876
- | CreateEvalGuardrailConfigEvalsResponseBoolean
877
- | CreateEvalGuardrailConfigEvalsResponseCategorical
878
- | CreateEvalGuardrailConfigEvalsResponseNumber
879
- | null
880
- | undefined;
881
- type: CreateEvalResponseBodyType;
882
- url: string;
883
- method: CreateEvalResponseBodyMethod;
884
- headers: { [k: string]: string };
885
- payload: { [k: string]: any };
886
- key: string;
887
- };
888
-
889
- export const CreateEvalGuardrailConfigEvalsOperator = {
890
- Eq: "eq",
891
- Ne: "ne",
892
- Gt: "gt",
893
- Gte: "gte",
894
- Lt: "lt",
895
- Lte: "lte",
896
- } as const;
897
- export type CreateEvalGuardrailConfigEvalsOperator = ClosedEnum<
898
- typeof CreateEvalGuardrailConfigEvalsOperator
899
- >;
900
-
901
- export type CreateEvalGuardrailConfigEvalsNumber = {
902
- enabled: boolean;
903
- alertOnFailure: boolean;
904
- type: "number";
905
- value: number;
906
- operator: CreateEvalGuardrailConfigEvalsOperator;
907
- };
908
-
909
- export type CreateEvalGuardrailConfigEvalsCategorical = {
910
- enabled: boolean;
911
- alertOnFailure: boolean;
912
- type: "categorical";
913
- values: Array<string>;
914
- };
915
-
916
- export type CreateEvalGuardrailConfigEvalsBoolean = {
917
- enabled: boolean;
918
- alertOnFailure: boolean;
919
- type: "boolean";
920
- value: boolean;
921
- };
922
-
923
- export type ResponseBodyGuardrailConfig =
924
- | CreateEvalGuardrailConfigEvalsBoolean
925
- | CreateEvalGuardrailConfigEvalsCategorical
926
- | CreateEvalGuardrailConfigEvalsNumber;
927
-
928
- export const ResponseBodyType = {
929
- JsonSchema: "json_schema",
930
- } as const;
931
- export type ResponseBodyType = ClosedEnum<typeof ResponseBodyType>;
932
-
933
- export type Json = {
934
- id: string;
935
- description: string;
936
- created: string;
937
- updated: string;
938
- updatedById?: string | null | undefined;
939
- guardrailConfig?:
940
- | CreateEvalGuardrailConfigEvalsBoolean
941
- | CreateEvalGuardrailConfigEvalsCategorical
942
- | CreateEvalGuardrailConfigEvalsNumber
943
- | null
944
- | undefined;
945
- type: ResponseBodyType;
946
- schema: string;
947
- key: string;
948
- };
949
-
950
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Operator =
951
- {
952
- Eq: "eq",
953
- Ne: "ne",
954
- Gt: "gt",
955
- Gte: "gte",
956
- Lt: "lt",
957
- Lte: "lte",
958
- } as const;
959
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Operator =
960
- ClosedEnum<
961
- typeof CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Operator
962
- >;
963
-
964
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Number =
965
- {
966
- enabled: boolean;
967
- alertOnFailure: boolean;
968
- type: "number";
969
- value: number;
970
- operator:
971
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Operator;
972
- };
973
-
974
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Categorical =
975
- {
976
- enabled: boolean;
977
- alertOnFailure: boolean;
978
- type: "categorical";
979
- values: Array<string>;
980
- };
981
-
982
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Boolean =
983
- {
984
- enabled: boolean;
985
- alertOnFailure: boolean;
986
- type: "boolean";
987
- value: boolean;
988
- };
989
-
990
- export type CreateEvalLLMEvalsResponseGuardrailConfig =
991
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Boolean
992
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Categorical
993
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Number;
994
-
995
- export const CreateEvalLLMEvalsResponseType = {
996
- LlmEval: "llm_eval",
997
- } as const;
998
- export type CreateEvalLLMEvalsResponseType = ClosedEnum<
999
- typeof CreateEvalLLMEvalsResponseType
1000
- >;
1001
-
1002
- export type CreateEvalLLMEvalsCategoricalLabels = {
1003
- value: string;
1004
- description?: string | undefined;
1005
- };
1006
-
1007
- export type CreateEvalLLMEvalsResponseRetry = {
1008
- count: number;
1009
- onCodes?: Array<number> | undefined;
1010
- };
1011
-
1012
- export type CreateEvalLLMEvalsResponseFallbacks = {
1013
- model: string;
1014
- };
1015
-
1016
- export type CreateEvalLLMJudges = {
1017
- model: string;
1018
- retry?: CreateEvalLLMEvalsResponseRetry | undefined;
1019
- fallbacks?: Array<CreateEvalLLMEvalsResponseFallbacks> | undefined;
1020
- };
1021
-
1022
- export type CreateEvalLLMEvalsRetry = {
1023
- count: number;
1024
- onCodes?: Array<number> | undefined;
1025
- };
1026
-
1027
- export type CreateEvalLLMEvalsFallbacks = {
1028
- model: string;
1029
- };
1030
-
1031
- export type CreateEvalLLMReplacementJudges = {
1032
- model: string;
1033
- retry?: CreateEvalLLMEvalsRetry | undefined;
1034
- fallbacks?: Array<CreateEvalLLMEvalsFallbacks> | undefined;
1035
- };
1036
-
1037
- export const CreateEvalLLMTieValue = {
1038
- Tie: "Tie",
1039
- } as const;
1040
- export type CreateEvalLLMTieValue = ClosedEnum<typeof CreateEvalLLMTieValue>;
1041
-
1042
- export type CreateEvalLLMJury = {
1043
- judges: Array<CreateEvalLLMJudges>;
1044
- replacementJudges?: Array<CreateEvalLLMReplacementJudges> | undefined;
1045
- minSuccessfulJudges: number;
1046
- tieValue: CreateEvalLLMTieValue;
1047
- };
1048
-
1049
- export type CreateEvalLlm2 = {
1050
- id: string;
1051
- description: string;
1052
- created: string;
1053
- updated: string;
1054
- updatedById?: string | null | undefined;
1055
- guardrailConfig?:
1056
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Boolean
1057
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Categorical
1058
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Number
1059
- | null
1060
- | undefined;
1061
- type: CreateEvalLLMEvalsResponseType;
1062
- repetitions?: number | null | undefined;
1063
- prompt: string;
1064
- categories?: Array<string> | null | undefined;
1065
- categoricalLabels?:
1066
- | Array<CreateEvalLLMEvalsCategoricalLabels>
1067
- | null
1068
- | undefined;
1069
- datasetId?: string | undefined;
1070
- key: string;
1071
- mode: "jury";
1072
- jury: CreateEvalLLMJury;
1073
- };
1074
-
1075
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMOperator =
1076
- {
1077
- Eq: "eq",
1078
- Ne: "ne",
1079
- Gt: "gt",
1080
- Gte: "gte",
1081
- Lt: "lt",
1082
- Lte: "lte",
1083
- } as const;
1084
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMOperator =
1085
- ClosedEnum<
1086
- typeof CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMOperator
1087
- >;
1088
-
1089
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMNumber =
1090
- {
1091
- enabled: boolean;
1092
- alertOnFailure: boolean;
1093
- type: "number";
1094
- value: number;
1095
- operator:
1096
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMOperator;
1097
- };
1098
-
1099
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMCategorical =
1100
- {
1101
- enabled: boolean;
1102
- alertOnFailure: boolean;
1103
- type: "categorical";
1104
- values: Array<string>;
1105
- };
1106
-
1107
- export type CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMBoolean =
1108
- {
1109
- enabled: boolean;
1110
- alertOnFailure: boolean;
1111
- type: "boolean";
1112
- value: boolean;
1113
- };
1114
-
1115
- export type CreateEvalLLMEvalsGuardrailConfig =
1116
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMBoolean
1117
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMCategorical
1118
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMNumber;
1119
-
1120
- export const CreateEvalLLMEvalsType = {
1121
- LlmEval: "llm_eval",
1122
- } as const;
1123
- export type CreateEvalLLMEvalsType = ClosedEnum<typeof CreateEvalLLMEvalsType>;
1124
-
1125
- export type CreateEvalLLMEvalsResponseCategoricalLabels = {
1126
- value: string;
1127
- description?: string | undefined;
1128
- };
1129
-
1130
- export type CreateEvalLlm1 = {
1131
- id: string;
1132
- description: string;
1133
- created: string;
1134
- updated: string;
1135
- updatedById?: string | null | undefined;
1136
- guardrailConfig?:
1137
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMBoolean
1138
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMCategorical
1139
- | CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMNumber
1140
- | null
1141
- | undefined;
1142
- type: CreateEvalLLMEvalsType;
1143
- repetitions?: number | null | undefined;
1144
- prompt: string;
1145
- categories?: Array<string> | null | undefined;
1146
- categoricalLabels?:
1147
- | Array<CreateEvalLLMEvalsResponseCategoricalLabels>
1148
- | null
1149
- | undefined;
1150
- datasetId?: string | undefined;
1151
- key: string;
1152
- mode: "single";
1153
- model: string;
1154
- };
1155
-
1156
- export type ResponseBodyLLM = CreateEvalLlm1 | CreateEvalLlm2;
1157
-
1158
- /**
1159
- * Successfully created an evaluator
1160
- */
1161
- export type CreateEvalResponseBody =
1162
- | CreateEvalResponseBodyHTTP
1163
- | Ragas
1164
- | Json
1165
- | ResponseBodyPython
1166
- | CreateEvalResponseBodyFunction
1167
- | Typescript
1168
- | CreateEvalLlm1
1169
- | CreateEvalLlm2;
1170
-
1171
- /** @internal */
1172
- export const GuardrailConfigOperator$outboundSchema: z.ZodNativeEnum<
1173
- typeof GuardrailConfigOperator
1174
- > = z.nativeEnum(GuardrailConfigOperator);
1175
-
1176
- /** @internal */
1177
- export type GuardrailConfigNumber$Outbound = {
1178
- enabled: boolean;
1179
- alert_on_failure: boolean;
1180
- type: "number";
1181
- value: number;
1182
- operator: string;
1183
- };
1184
-
1185
- /** @internal */
1186
- export const GuardrailConfigNumber$outboundSchema: z.ZodType<
1187
- GuardrailConfigNumber$Outbound,
1188
- z.ZodTypeDef,
1189
- GuardrailConfigNumber
1190
- > = z.object({
1191
- enabled: z.boolean().default(true),
1192
- alertOnFailure: z.boolean().default(false),
1193
- type: z.literal("number"),
1194
- value: z.number(),
1195
- operator: GuardrailConfigOperator$outboundSchema,
1196
- }).transform((v) => {
1197
- return remap$(v, {
1198
- alertOnFailure: "alert_on_failure",
1199
- });
1200
- });
1201
-
1202
- export function guardrailConfigNumberToJSON(
1203
- guardrailConfigNumber: GuardrailConfigNumber,
1204
- ): string {
1205
- return JSON.stringify(
1206
- GuardrailConfigNumber$outboundSchema.parse(guardrailConfigNumber),
1207
- );
1208
- }
1209
-
1210
- /** @internal */
1211
- export type GuardrailConfigCategorical$Outbound = {
1212
- enabled: boolean;
1213
- alert_on_failure: boolean;
1214
- type: "categorical";
1215
- values: Array<string>;
1216
- };
1217
-
1218
- /** @internal */
1219
- export const GuardrailConfigCategorical$outboundSchema: z.ZodType<
1220
- GuardrailConfigCategorical$Outbound,
1221
- z.ZodTypeDef,
1222
- GuardrailConfigCategorical
1223
- > = z.object({
1224
- enabled: z.boolean().default(true),
1225
- alertOnFailure: z.boolean().default(false),
1226
- type: z.literal("categorical"),
1227
- values: z.array(z.string()),
1228
- }).transform((v) => {
1229
- return remap$(v, {
1230
- alertOnFailure: "alert_on_failure",
1231
- });
1232
- });
1233
-
1234
- export function guardrailConfigCategoricalToJSON(
1235
- guardrailConfigCategorical: GuardrailConfigCategorical,
1236
- ): string {
1237
- return JSON.stringify(
1238
- GuardrailConfigCategorical$outboundSchema.parse(guardrailConfigCategorical),
1239
- );
1240
- }
1241
-
1242
- /** @internal */
1243
- export type GuardrailConfigBoolean$Outbound = {
1244
- enabled: boolean;
1245
- alert_on_failure: boolean;
1246
- type: "boolean";
1247
- value: boolean;
1248
- };
1249
-
1250
- /** @internal */
1251
- export const GuardrailConfigBoolean$outboundSchema: z.ZodType<
1252
- GuardrailConfigBoolean$Outbound,
1253
- z.ZodTypeDef,
1254
- GuardrailConfigBoolean
1255
- > = z.object({
1256
- enabled: z.boolean().default(true),
1257
- alertOnFailure: z.boolean().default(false),
1258
- type: z.literal("boolean"),
1259
- value: z.boolean(),
1260
- }).transform((v) => {
1261
- return remap$(v, {
1262
- alertOnFailure: "alert_on_failure",
1263
- });
1264
- });
1265
-
1266
- export function guardrailConfigBooleanToJSON(
1267
- guardrailConfigBoolean: GuardrailConfigBoolean,
1268
- ): string {
1269
- return JSON.stringify(
1270
- GuardrailConfigBoolean$outboundSchema.parse(guardrailConfigBoolean),
1271
- );
1272
- }
1273
-
1274
- /** @internal */
1275
- export type RequestBodyGuardrailConfig$Outbound =
1276
- | GuardrailConfigBoolean$Outbound
1277
- | GuardrailConfigCategorical$Outbound
1278
- | GuardrailConfigNumber$Outbound;
1279
-
1280
- /** @internal */
1281
- export const RequestBodyGuardrailConfig$outboundSchema: z.ZodType<
1282
- RequestBodyGuardrailConfig$Outbound,
1283
- z.ZodTypeDef,
1284
- RequestBodyGuardrailConfig
1285
- > = z.union([
1286
- z.lazy(() => GuardrailConfigBoolean$outboundSchema),
1287
- z.lazy(() => GuardrailConfigCategorical$outboundSchema),
1288
- z.lazy(() => GuardrailConfigNumber$outboundSchema),
1289
- ]);
1290
-
1291
- export function requestBodyGuardrailConfigToJSON(
1292
- requestBodyGuardrailConfig: RequestBodyGuardrailConfig,
1293
- ): string {
1294
- return JSON.stringify(
1295
- RequestBodyGuardrailConfig$outboundSchema.parse(requestBodyGuardrailConfig),
1296
- );
1297
- }
1298
-
1299
- /** @internal */
1300
- export const OutputType$outboundSchema: z.ZodNativeEnum<typeof OutputType> = z
1301
- .nativeEnum(OutputType);
1302
-
1303
- /** @internal */
1304
- export const RequestBodyType$outboundSchema: z.ZodNativeEnum<
1305
- typeof RequestBodyType
1306
- > = z.nativeEnum(RequestBodyType);
1307
-
1308
- /** @internal */
1309
- export type Python$Outbound = {
1310
- guardrail_config?:
1311
- | GuardrailConfigBoolean$Outbound
1312
- | GuardrailConfigCategorical$Outbound
1313
- | GuardrailConfigNumber$Outbound
1314
- | null
1315
- | undefined;
1316
- output_type?: string | undefined;
1317
- code: string;
1318
- type: string;
1319
- path: string;
1320
- description: string;
1321
- key: string;
1322
- };
1323
-
1324
- /** @internal */
1325
- export const Python$outboundSchema: z.ZodType<
1326
- Python$Outbound,
1327
- z.ZodTypeDef,
1328
- Python
1329
- > = z.object({
1330
- guardrailConfig: z.nullable(
1331
- z.union([
1332
- z.lazy(() => GuardrailConfigBoolean$outboundSchema),
1333
- z.lazy(() => GuardrailConfigCategorical$outboundSchema),
1334
- z.lazy(() => GuardrailConfigNumber$outboundSchema),
1335
- ]),
1336
- ).optional(),
1337
- outputType: OutputType$outboundSchema.optional(),
1338
- code: z.string(),
1339
- type: RequestBodyType$outboundSchema,
1340
- path: z.string(),
1341
- description: z.string().default(""),
1342
- key: z.string(),
1343
- }).transform((v) => {
1344
- return remap$(v, {
1345
- guardrailConfig: "guardrail_config",
1346
- outputType: "output_type",
1347
- });
1348
- });
1349
-
1350
- export function pythonToJSON(python: Python): string {
1351
- return JSON.stringify(Python$outboundSchema.parse(python));
1352
- }
1353
-
1354
- /** @internal */
1355
- export const CreateEvalGuardrailConfigEvalsRequestOperator$outboundSchema:
1356
- z.ZodNativeEnum<typeof CreateEvalGuardrailConfigEvalsRequestOperator> = z
1357
- .nativeEnum(CreateEvalGuardrailConfigEvalsRequestOperator);
1358
-
1359
- /** @internal */
1360
- export type CreateEvalGuardrailConfigEvalsRequestNumber$Outbound = {
1361
- enabled: boolean;
1362
- alert_on_failure: boolean;
1363
- type: "number";
1364
- value: number;
1365
- operator: string;
1366
- };
1367
-
1368
- /** @internal */
1369
- export const CreateEvalGuardrailConfigEvalsRequestNumber$outboundSchema:
1370
- z.ZodType<
1371
- CreateEvalGuardrailConfigEvalsRequestNumber$Outbound,
1372
- z.ZodTypeDef,
1373
- CreateEvalGuardrailConfigEvalsRequestNumber
1374
- > = z.object({
1375
- enabled: z.boolean().default(true),
1376
- alertOnFailure: z.boolean().default(false),
1377
- type: z.literal("number"),
1378
- value: z.number(),
1379
- operator: CreateEvalGuardrailConfigEvalsRequestOperator$outboundSchema,
1380
- }).transform((v) => {
1381
- return remap$(v, {
1382
- alertOnFailure: "alert_on_failure",
1383
- });
1384
- });
1385
-
1386
- export function createEvalGuardrailConfigEvalsRequestNumberToJSON(
1387
- createEvalGuardrailConfigEvalsRequestNumber:
1388
- CreateEvalGuardrailConfigEvalsRequestNumber,
1389
- ): string {
1390
- return JSON.stringify(
1391
- CreateEvalGuardrailConfigEvalsRequestNumber$outboundSchema.parse(
1392
- createEvalGuardrailConfigEvalsRequestNumber,
1393
- ),
1394
- );
1395
- }
1396
-
1397
- /** @internal */
1398
- export type CreateEvalGuardrailConfigEvalsRequestCategorical$Outbound = {
1399
- enabled: boolean;
1400
- alert_on_failure: boolean;
1401
- type: "categorical";
1402
- values: Array<string>;
1403
- };
1404
-
1405
- /** @internal */
1406
- export const CreateEvalGuardrailConfigEvalsRequestCategorical$outboundSchema:
1407
- z.ZodType<
1408
- CreateEvalGuardrailConfigEvalsRequestCategorical$Outbound,
1409
- z.ZodTypeDef,
1410
- CreateEvalGuardrailConfigEvalsRequestCategorical
1411
- > = z.object({
1412
- enabled: z.boolean().default(true),
1413
- alertOnFailure: z.boolean().default(false),
1414
- type: z.literal("categorical"),
1415
- values: z.array(z.string()),
1416
- }).transform((v) => {
1417
- return remap$(v, {
1418
- alertOnFailure: "alert_on_failure",
1419
- });
1420
- });
1421
-
1422
- export function createEvalGuardrailConfigEvalsRequestCategoricalToJSON(
1423
- createEvalGuardrailConfigEvalsRequestCategorical:
1424
- CreateEvalGuardrailConfigEvalsRequestCategorical,
1425
- ): string {
1426
- return JSON.stringify(
1427
- CreateEvalGuardrailConfigEvalsRequestCategorical$outboundSchema.parse(
1428
- createEvalGuardrailConfigEvalsRequestCategorical,
1429
- ),
1430
- );
1431
- }
1432
-
1433
- /** @internal */
1434
- export type CreateEvalGuardrailConfigEvalsRequestBoolean$Outbound = {
1435
- enabled: boolean;
1436
- alert_on_failure: boolean;
1437
- type: "boolean";
1438
- value: boolean;
1439
- };
1440
-
1441
- /** @internal */
1442
- export const CreateEvalGuardrailConfigEvalsRequestBoolean$outboundSchema:
1443
- z.ZodType<
1444
- CreateEvalGuardrailConfigEvalsRequestBoolean$Outbound,
1445
- z.ZodTypeDef,
1446
- CreateEvalGuardrailConfigEvalsRequestBoolean
1447
- > = z.object({
1448
- enabled: z.boolean().default(true),
1449
- alertOnFailure: z.boolean().default(false),
1450
- type: z.literal("boolean"),
1451
- value: z.boolean(),
1452
- }).transform((v) => {
1453
- return remap$(v, {
1454
- alertOnFailure: "alert_on_failure",
1455
- });
1456
- });
1457
-
1458
- export function createEvalGuardrailConfigEvalsRequestBooleanToJSON(
1459
- createEvalGuardrailConfigEvalsRequestBoolean:
1460
- CreateEvalGuardrailConfigEvalsRequestBoolean,
1461
- ): string {
1462
- return JSON.stringify(
1463
- CreateEvalGuardrailConfigEvalsRequestBoolean$outboundSchema.parse(
1464
- createEvalGuardrailConfigEvalsRequestBoolean,
1465
- ),
1466
- );
1467
- }
1468
-
1469
- /** @internal */
1470
- export type LLMGuardrailConfig$Outbound =
1471
- | CreateEvalGuardrailConfigEvalsRequestBoolean$Outbound
1472
- | CreateEvalGuardrailConfigEvalsRequestCategorical$Outbound
1473
- | CreateEvalGuardrailConfigEvalsRequestNumber$Outbound;
1474
-
1475
- /** @internal */
1476
- export const LLMGuardrailConfig$outboundSchema: z.ZodType<
1477
- LLMGuardrailConfig$Outbound,
1478
- z.ZodTypeDef,
1479
- LLMGuardrailConfig
1480
- > = z.union([
1481
- z.lazy(() => CreateEvalGuardrailConfigEvalsRequestBoolean$outboundSchema),
1482
- z.lazy(() => CreateEvalGuardrailConfigEvalsRequestCategorical$outboundSchema),
1483
- z.lazy(() => CreateEvalGuardrailConfigEvalsRequestNumber$outboundSchema),
1484
- ]);
1485
-
1486
- export function llmGuardrailConfigToJSON(
1487
- llmGuardrailConfig: LLMGuardrailConfig,
1488
- ): string {
1489
- return JSON.stringify(
1490
- LLMGuardrailConfig$outboundSchema.parse(llmGuardrailConfig),
1491
- );
1492
- }
1493
-
1494
- /** @internal */
1495
- export const LLMOutputType$outboundSchema: z.ZodNativeEnum<
1496
- typeof LLMOutputType
1497
- > = z.nativeEnum(LLMOutputType);
1498
-
1499
- /** @internal */
1500
- export const LLMType$outboundSchema: z.ZodNativeEnum<typeof LLMType> = z
1501
- .nativeEnum(LLMType);
1502
-
1503
- /** @internal */
1504
- export type LLMCategoricalLabels$Outbound = {
1505
- value: string;
1506
- description?: string | undefined;
1507
- };
1508
-
1509
- /** @internal */
1510
- export const LLMCategoricalLabels$outboundSchema: z.ZodType<
1511
- LLMCategoricalLabels$Outbound,
1512
- z.ZodTypeDef,
1513
- LLMCategoricalLabels
1514
- > = z.object({
1515
- value: z.string(),
1516
- description: z.string().optional(),
1517
- });
1518
-
1519
- export function llmCategoricalLabelsToJSON(
1520
- llmCategoricalLabels: LLMCategoricalLabels,
1521
- ): string {
1522
- return JSON.stringify(
1523
- LLMCategoricalLabels$outboundSchema.parse(llmCategoricalLabels),
1524
- );
1525
- }
1526
-
1527
- /** @internal */
1528
- export type CreateEvalLLMRetry$Outbound = {
1529
- count: number;
1530
- on_codes?: Array<number> | undefined;
1531
- };
1532
-
1533
- /** @internal */
1534
- export const CreateEvalLLMRetry$outboundSchema: z.ZodType<
1535
- CreateEvalLLMRetry$Outbound,
1536
- z.ZodTypeDef,
1537
- CreateEvalLLMRetry
1538
- > = z.object({
1539
- count: z.number().int().default(2),
1540
- onCodes: z.array(z.number().int()).optional(),
1541
- }).transform((v) => {
1542
- return remap$(v, {
1543
- onCodes: "on_codes",
1544
- });
1545
- });
1546
-
1547
- export function createEvalLLMRetryToJSON(
1548
- createEvalLLMRetry: CreateEvalLLMRetry,
1549
- ): string {
1550
- return JSON.stringify(
1551
- CreateEvalLLMRetry$outboundSchema.parse(createEvalLLMRetry),
1552
- );
1553
- }
1554
-
1555
- /** @internal */
1556
- export type CreateEvalLLMFallbacks$Outbound = {
1557
- model: string;
1558
- };
1559
-
1560
- /** @internal */
1561
- export const CreateEvalLLMFallbacks$outboundSchema: z.ZodType<
1562
- CreateEvalLLMFallbacks$Outbound,
1563
- z.ZodTypeDef,
1564
- CreateEvalLLMFallbacks
1565
- > = z.object({
1566
- model: z.string(),
1567
- });
1568
-
1569
- export function createEvalLLMFallbacksToJSON(
1570
- createEvalLLMFallbacks: CreateEvalLLMFallbacks,
1571
- ): string {
1572
- return JSON.stringify(
1573
- CreateEvalLLMFallbacks$outboundSchema.parse(createEvalLLMFallbacks),
1574
- );
1575
- }
1576
-
1577
- /** @internal */
1578
- export type LLMJudges$Outbound = {
1579
- model: string;
1580
- retry?: CreateEvalLLMRetry$Outbound | undefined;
1581
- fallbacks?: Array<CreateEvalLLMFallbacks$Outbound> | undefined;
1582
- };
1583
-
1584
- /** @internal */
1585
- export const LLMJudges$outboundSchema: z.ZodType<
1586
- LLMJudges$Outbound,
1587
- z.ZodTypeDef,
1588
- LLMJudges
1589
- > = z.object({
1590
- model: z.string(),
1591
- retry: z.lazy(() => CreateEvalLLMRetry$outboundSchema).optional(),
1592
- fallbacks: z.array(z.lazy(() => CreateEvalLLMFallbacks$outboundSchema))
1593
- .optional(),
1594
- });
1595
-
1596
- export function llmJudgesToJSON(llmJudges: LLMJudges): string {
1597
- return JSON.stringify(LLMJudges$outboundSchema.parse(llmJudges));
1598
- }
1599
-
1600
- /** @internal */
1601
- export type LLMRetry$Outbound = {
1602
- count: number;
1603
- on_codes?: Array<number> | undefined;
1604
- };
1605
-
1606
- /** @internal */
1607
- export const LLMRetry$outboundSchema: z.ZodType<
1608
- LLMRetry$Outbound,
1609
- z.ZodTypeDef,
1610
- LLMRetry
1611
- > = z.object({
1612
- count: z.number().int().default(2),
1613
- onCodes: z.array(z.number().int()).optional(),
1614
- }).transform((v) => {
1615
- return remap$(v, {
1616
- onCodes: "on_codes",
1617
- });
1618
- });
1619
-
1620
- export function llmRetryToJSON(llmRetry: LLMRetry): string {
1621
- return JSON.stringify(LLMRetry$outboundSchema.parse(llmRetry));
1622
- }
1623
-
1624
- /** @internal */
1625
- export type LLMFallbacks$Outbound = {
1626
- model: string;
1627
- };
1628
-
1629
- /** @internal */
1630
- export const LLMFallbacks$outboundSchema: z.ZodType<
1631
- LLMFallbacks$Outbound,
1632
- z.ZodTypeDef,
1633
- LLMFallbacks
1634
- > = z.object({
1635
- model: z.string(),
1636
- });
1637
-
1638
- export function llmFallbacksToJSON(llmFallbacks: LLMFallbacks): string {
1639
- return JSON.stringify(LLMFallbacks$outboundSchema.parse(llmFallbacks));
1640
- }
1641
-
1642
- /** @internal */
1643
- export type LLMReplacementJudges$Outbound = {
1644
- model: string;
1645
- retry?: LLMRetry$Outbound | undefined;
1646
- fallbacks?: Array<LLMFallbacks$Outbound> | undefined;
1647
- };
1648
-
1649
- /** @internal */
1650
- export const LLMReplacementJudges$outboundSchema: z.ZodType<
1651
- LLMReplacementJudges$Outbound,
1652
- z.ZodTypeDef,
1653
- LLMReplacementJudges
1654
- > = z.object({
1655
- model: z.string(),
1656
- retry: z.lazy(() => LLMRetry$outboundSchema).optional(),
1657
- fallbacks: z.array(z.lazy(() => LLMFallbacks$outboundSchema)).optional(),
1658
- });
1659
-
1660
- export function llmReplacementJudgesToJSON(
1661
- llmReplacementJudges: LLMReplacementJudges,
1662
- ): string {
1663
- return JSON.stringify(
1664
- LLMReplacementJudges$outboundSchema.parse(llmReplacementJudges),
1665
- );
1666
- }
1667
-
1668
- /** @internal */
1669
- export const LLMTieValue$outboundSchema: z.ZodNativeEnum<typeof LLMTieValue> = z
1670
- .nativeEnum(LLMTieValue);
1671
-
1672
- /** @internal */
1673
- export type LLMJury$Outbound = {
1674
- judges: Array<LLMJudges$Outbound>;
1675
- replacement_judges?: Array<LLMReplacementJudges$Outbound> | undefined;
1676
- min_successful_judges: number;
1677
- tie_value: string;
1678
- };
1679
-
1680
- /** @internal */
1681
- export const LLMJury$outboundSchema: z.ZodType<
1682
- LLMJury$Outbound,
1683
- z.ZodTypeDef,
1684
- LLMJury
1685
- > = z.object({
1686
- judges: z.array(z.lazy(() => LLMJudges$outboundSchema)),
1687
- replacementJudges: z.array(z.lazy(() => LLMReplacementJudges$outboundSchema))
1688
- .optional(),
1689
- minSuccessfulJudges: z.number().int().default(2),
1690
- tieValue: LLMTieValue$outboundSchema.default("Tie"),
1691
- }).transform((v) => {
1692
- return remap$(v, {
1693
- replacementJudges: "replacement_judges",
1694
- minSuccessfulJudges: "min_successful_judges",
1695
- tieValue: "tie_value",
1696
- });
1697
- });
1698
-
1699
- export function llmJuryToJSON(llmJury: LLMJury): string {
1700
- return JSON.stringify(LLMJury$outboundSchema.parse(llmJury));
1701
- }
1702
-
1703
- /** @internal */
1704
- export type Llm2$Outbound = {
1705
- guardrail_config?:
1706
- | CreateEvalGuardrailConfigEvalsRequestBoolean$Outbound
1707
- | CreateEvalGuardrailConfigEvalsRequestCategorical$Outbound
1708
- | CreateEvalGuardrailConfigEvalsRequestNumber$Outbound
1709
- | null
1710
- | undefined;
1711
- output_type?: string | undefined;
1712
- type: string;
1713
- repetitions?: number | null | undefined;
1714
- prompt: string;
1715
- categories?: Array<string> | null | undefined;
1716
- categorical_labels?: Array<LLMCategoricalLabels$Outbound> | null | undefined;
1717
- dataset_id?: string | undefined;
1718
- path: string;
1719
- description: string;
1720
- key: string;
1721
- mode: "jury";
1722
- jury: LLMJury$Outbound;
1723
- };
1724
-
1725
- /** @internal */
1726
- export const Llm2$outboundSchema: z.ZodType<Llm2$Outbound, z.ZodTypeDef, Llm2> =
1727
- z.object({
1728
- guardrailConfig: z.nullable(
1729
- z.union([
1730
- z.lazy(() =>
1731
- CreateEvalGuardrailConfigEvalsRequestBoolean$outboundSchema
1732
- ),
1733
- z.lazy(() =>
1734
- CreateEvalGuardrailConfigEvalsRequestCategorical$outboundSchema
1735
- ),
1736
- z.lazy(() =>
1737
- CreateEvalGuardrailConfigEvalsRequestNumber$outboundSchema
1738
- ),
1739
- ]),
1740
- ).optional(),
1741
- outputType: LLMOutputType$outboundSchema.optional(),
1742
- type: LLMType$outboundSchema,
1743
- repetitions: z.nullable(z.number().int()).optional(),
1744
- prompt: z.string(),
1745
- categories: z.nullable(z.array(z.string())).optional(),
1746
- categoricalLabels: z.nullable(
1747
- z.array(z.lazy(() => LLMCategoricalLabels$outboundSchema)),
1748
- ).optional(),
1749
- datasetId: z.string().optional(),
1750
- path: z.string(),
1751
- description: z.string().default(""),
1752
- key: z.string(),
1753
- mode: z.literal("jury"),
1754
- jury: z.lazy(() => LLMJury$outboundSchema),
1755
- }).transform((v) => {
1756
- return remap$(v, {
1757
- guardrailConfig: "guardrail_config",
1758
- outputType: "output_type",
1759
- categoricalLabels: "categorical_labels",
1760
- datasetId: "dataset_id",
1761
- });
1762
- });
1763
-
1764
- export function llm2ToJSON(llm2: Llm2): string {
1765
- return JSON.stringify(Llm2$outboundSchema.parse(llm2));
1766
- }
1767
-
1768
- /** @internal */
1769
- export const CreateEvalGuardrailConfigOperator$outboundSchema: z.ZodNativeEnum<
1770
- typeof CreateEvalGuardrailConfigOperator
1771
- > = z.nativeEnum(CreateEvalGuardrailConfigOperator);
1772
-
1773
- /** @internal */
1774
- export type CreateEvalGuardrailConfigNumber$Outbound = {
1775
- enabled: boolean;
1776
- alert_on_failure: boolean;
1777
- type: "number";
1778
- value: number;
1779
- operator: string;
1780
- };
1781
-
1782
- /** @internal */
1783
- export const CreateEvalGuardrailConfigNumber$outboundSchema: z.ZodType<
1784
- CreateEvalGuardrailConfigNumber$Outbound,
1785
- z.ZodTypeDef,
1786
- CreateEvalGuardrailConfigNumber
1787
- > = z.object({
1788
- enabled: z.boolean().default(true),
1789
- alertOnFailure: z.boolean().default(false),
1790
- type: z.literal("number"),
1791
- value: z.number(),
1792
- operator: CreateEvalGuardrailConfigOperator$outboundSchema,
1793
- }).transform((v) => {
1794
- return remap$(v, {
1795
- alertOnFailure: "alert_on_failure",
1796
- });
1797
- });
1798
-
1799
- export function createEvalGuardrailConfigNumberToJSON(
1800
- createEvalGuardrailConfigNumber: CreateEvalGuardrailConfigNumber,
1801
- ): string {
1802
- return JSON.stringify(
1803
- CreateEvalGuardrailConfigNumber$outboundSchema.parse(
1804
- createEvalGuardrailConfigNumber,
1805
- ),
1806
- );
1807
- }
1808
-
1809
- /** @internal */
1810
- export type CreateEvalGuardrailConfigCategorical$Outbound = {
1811
- enabled: boolean;
1812
- alert_on_failure: boolean;
1813
- type: "categorical";
1814
- values: Array<string>;
1815
- };
1816
-
1817
- /** @internal */
1818
- export const CreateEvalGuardrailConfigCategorical$outboundSchema: z.ZodType<
1819
- CreateEvalGuardrailConfigCategorical$Outbound,
1820
- z.ZodTypeDef,
1821
- CreateEvalGuardrailConfigCategorical
1822
- > = z.object({
1823
- enabled: z.boolean().default(true),
1824
- alertOnFailure: z.boolean().default(false),
1825
- type: z.literal("categorical"),
1826
- values: z.array(z.string()),
1827
- }).transform((v) => {
1828
- return remap$(v, {
1829
- alertOnFailure: "alert_on_failure",
1830
- });
1831
- });
1832
-
1833
- export function createEvalGuardrailConfigCategoricalToJSON(
1834
- createEvalGuardrailConfigCategorical: CreateEvalGuardrailConfigCategorical,
1835
- ): string {
1836
- return JSON.stringify(
1837
- CreateEvalGuardrailConfigCategorical$outboundSchema.parse(
1838
- createEvalGuardrailConfigCategorical,
1839
- ),
1840
- );
1841
- }
1842
-
1843
- /** @internal */
1844
- export type CreateEvalGuardrailConfigBoolean$Outbound = {
1845
- enabled: boolean;
1846
- alert_on_failure: boolean;
1847
- type: "boolean";
1848
- value: boolean;
1849
- };
1850
-
1851
- /** @internal */
1852
- export const CreateEvalGuardrailConfigBoolean$outboundSchema: z.ZodType<
1853
- CreateEvalGuardrailConfigBoolean$Outbound,
1854
- z.ZodTypeDef,
1855
- CreateEvalGuardrailConfigBoolean
1856
- > = z.object({
1857
- enabled: z.boolean().default(true),
1858
- alertOnFailure: z.boolean().default(false),
1859
- type: z.literal("boolean"),
1860
- value: z.boolean(),
1861
- }).transform((v) => {
1862
- return remap$(v, {
1863
- alertOnFailure: "alert_on_failure",
1864
- });
1865
- });
1866
-
1867
- export function createEvalGuardrailConfigBooleanToJSON(
1868
- createEvalGuardrailConfigBoolean: CreateEvalGuardrailConfigBoolean,
1869
- ): string {
1870
- return JSON.stringify(
1871
- CreateEvalGuardrailConfigBoolean$outboundSchema.parse(
1872
- createEvalGuardrailConfigBoolean,
1873
- ),
1874
- );
1875
- }
1876
-
1877
- /** @internal */
1878
- export type CreateEvalLLMGuardrailConfig$Outbound =
1879
- | CreateEvalGuardrailConfigBoolean$Outbound
1880
- | CreateEvalGuardrailConfigCategorical$Outbound
1881
- | CreateEvalGuardrailConfigNumber$Outbound;
1882
-
1883
- /** @internal */
1884
- export const CreateEvalLLMGuardrailConfig$outboundSchema: z.ZodType<
1885
- CreateEvalLLMGuardrailConfig$Outbound,
1886
- z.ZodTypeDef,
1887
- CreateEvalLLMGuardrailConfig
1888
- > = z.union([
1889
- z.lazy(() => CreateEvalGuardrailConfigBoolean$outboundSchema),
1890
- z.lazy(() => CreateEvalGuardrailConfigCategorical$outboundSchema),
1891
- z.lazy(() => CreateEvalGuardrailConfigNumber$outboundSchema),
1892
- ]);
1893
-
1894
- export function createEvalLLMGuardrailConfigToJSON(
1895
- createEvalLLMGuardrailConfig: CreateEvalLLMGuardrailConfig,
1896
- ): string {
1897
- return JSON.stringify(
1898
- CreateEvalLLMGuardrailConfig$outboundSchema.parse(
1899
- createEvalLLMGuardrailConfig,
1900
- ),
1901
- );
1902
- }
1903
-
1904
- /** @internal */
1905
- export const CreateEvalLLMOutputType$outboundSchema: z.ZodNativeEnum<
1906
- typeof CreateEvalLLMOutputType
1907
- > = z.nativeEnum(CreateEvalLLMOutputType);
1908
-
1909
- /** @internal */
1910
- export const CreateEvalLLMType$outboundSchema: z.ZodNativeEnum<
1911
- typeof CreateEvalLLMType
1912
- > = z.nativeEnum(CreateEvalLLMType);
1913
-
1914
- /** @internal */
1915
- export type CreateEvalLLMCategoricalLabels$Outbound = {
1916
- value: string;
1917
- description?: string | undefined;
1918
- };
1919
-
1920
- /** @internal */
1921
- export const CreateEvalLLMCategoricalLabels$outboundSchema: z.ZodType<
1922
- CreateEvalLLMCategoricalLabels$Outbound,
1923
- z.ZodTypeDef,
1924
- CreateEvalLLMCategoricalLabels
1925
- > = z.object({
1926
- value: z.string(),
1927
- description: z.string().optional(),
1928
- });
1929
-
1930
- export function createEvalLLMCategoricalLabelsToJSON(
1931
- createEvalLLMCategoricalLabels: CreateEvalLLMCategoricalLabels,
1932
- ): string {
1933
- return JSON.stringify(
1934
- CreateEvalLLMCategoricalLabels$outboundSchema.parse(
1935
- createEvalLLMCategoricalLabels,
1936
- ),
1937
- );
1938
- }
1939
-
1940
- /** @internal */
1941
- export type Llm1$Outbound = {
1942
- guardrail_config?:
1943
- | CreateEvalGuardrailConfigBoolean$Outbound
1944
- | CreateEvalGuardrailConfigCategorical$Outbound
1945
- | CreateEvalGuardrailConfigNumber$Outbound
1946
- | null
1947
- | undefined;
1948
- output_type?: string | undefined;
1949
- type: string;
1950
- repetitions?: number | null | undefined;
1951
- prompt: string;
1952
- categories?: Array<string> | null | undefined;
1953
- categorical_labels?:
1954
- | Array<CreateEvalLLMCategoricalLabels$Outbound>
1955
- | null
1956
- | undefined;
1957
- dataset_id?: string | undefined;
1958
- path: string;
1959
- description: string;
1960
- key: string;
1961
- mode: "single";
1962
- model: string;
1963
- };
1964
-
1965
- /** @internal */
1966
- export const Llm1$outboundSchema: z.ZodType<Llm1$Outbound, z.ZodTypeDef, Llm1> =
1967
- z.object({
1968
- guardrailConfig: z.nullable(
1969
- z.union([
1970
- z.lazy(() => CreateEvalGuardrailConfigBoolean$outboundSchema),
1971
- z.lazy(() => CreateEvalGuardrailConfigCategorical$outboundSchema),
1972
- z.lazy(() => CreateEvalGuardrailConfigNumber$outboundSchema),
1973
- ]),
1974
- ).optional(),
1975
- outputType: CreateEvalLLMOutputType$outboundSchema.optional(),
1976
- type: CreateEvalLLMType$outboundSchema,
1977
- repetitions: z.nullable(z.number().int()).optional(),
1978
- prompt: z.string(),
1979
- categories: z.nullable(z.array(z.string())).optional(),
1980
- categoricalLabels: z.nullable(
1981
- z.array(z.lazy(() => CreateEvalLLMCategoricalLabels$outboundSchema)),
1982
- ).optional(),
1983
- datasetId: z.string().optional(),
1984
- path: z.string(),
1985
- description: z.string().default(""),
1986
- key: z.string(),
1987
- mode: z.literal("single"),
1988
- model: z.string(),
1989
- }).transform((v) => {
1990
- return remap$(v, {
1991
- guardrailConfig: "guardrail_config",
1992
- outputType: "output_type",
1993
- categoricalLabels: "categorical_labels",
1994
- datasetId: "dataset_id",
1995
- });
1996
- });
1997
-
1998
- export function llm1ToJSON(llm1: Llm1): string {
1999
- return JSON.stringify(Llm1$outboundSchema.parse(llm1));
2000
- }
2001
-
2002
- /** @internal */
2003
- export type Llm$Outbound = Llm1$Outbound | Llm2$Outbound;
2004
-
2005
- /** @internal */
2006
- export const Llm$outboundSchema: z.ZodType<Llm$Outbound, z.ZodTypeDef, Llm> = z
2007
- .union([
2008
- z.lazy(() => Llm1$outboundSchema),
2009
- z.lazy(() => Llm2$outboundSchema),
2010
- ]);
2011
-
2012
- export function llmToJSON(llm: Llm): string {
2013
- return JSON.stringify(Llm$outboundSchema.parse(llm));
2014
- }
2015
-
2016
- /** @internal */
2017
- export type CreateEvalRequestBody$Outbound =
2018
- | Python$Outbound
2019
- | Llm1$Outbound
2020
- | Llm2$Outbound;
2021
-
2022
- /** @internal */
2023
- export const CreateEvalRequestBody$outboundSchema: z.ZodType<
2024
- CreateEvalRequestBody$Outbound,
2025
- z.ZodTypeDef,
2026
- CreateEvalRequestBody
2027
- > = z.union([
2028
- z.lazy(() => Python$outboundSchema),
2029
- z.union([
2030
- z.lazy(() => Llm1$outboundSchema),
2031
- z.lazy(() => Llm2$outboundSchema),
2032
- ]),
2033
- ]);
2034
-
2035
- export function createEvalRequestBodyToJSON(
2036
- createEvalRequestBody: CreateEvalRequestBody,
2037
- ): string {
2038
- return JSON.stringify(
2039
- CreateEvalRequestBody$outboundSchema.parse(createEvalRequestBody),
2040
- );
2041
- }
2042
-
2043
- /** @internal */
2044
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Operator$inboundSchema:
2045
- z.ZodNativeEnum<
2046
- typeof CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Operator
2047
- > = z.nativeEnum(
2048
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Operator,
2049
- );
2050
-
2051
- /** @internal */
2052
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Number$inboundSchema:
2053
- z.ZodType<
2054
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Number,
2055
- z.ZodTypeDef,
2056
- unknown
2057
- > = z.object({
2058
- enabled: z.boolean().default(true),
2059
- alert_on_failure: z.boolean().default(false),
2060
- type: z.literal("number"),
2061
- value: z.number(),
2062
- operator:
2063
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Operator$inboundSchema,
2064
- }).transform((v) => {
2065
- return remap$(v, {
2066
- "alert_on_failure": "alertOnFailure",
2067
- });
2068
- });
2069
-
2070
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7NumberFromJSON(
2071
- jsonString: string,
2072
- ): SafeParseResult<
2073
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Number,
2074
- SDKValidationError
2075
- > {
2076
- return safeParse(
2077
- jsonString,
2078
- (x) =>
2079
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Number$inboundSchema
2080
- .parse(JSON.parse(x)),
2081
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Number' from JSON`,
2082
- );
2083
- }
2084
-
2085
- /** @internal */
2086
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Categorical$inboundSchema:
2087
- z.ZodType<
2088
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Categorical,
2089
- z.ZodTypeDef,
2090
- unknown
2091
- > = z.object({
2092
- enabled: z.boolean().default(true),
2093
- alert_on_failure: z.boolean().default(false),
2094
- type: z.literal("categorical"),
2095
- values: z.array(z.string()),
2096
- }).transform((v) => {
2097
- return remap$(v, {
2098
- "alert_on_failure": "alertOnFailure",
2099
- });
2100
- });
2101
-
2102
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7CategoricalFromJSON(
2103
- jsonString: string,
2104
- ): SafeParseResult<
2105
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Categorical,
2106
- SDKValidationError
2107
- > {
2108
- return safeParse(
2109
- jsonString,
2110
- (x) =>
2111
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Categorical$inboundSchema
2112
- .parse(JSON.parse(x)),
2113
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Categorical' from JSON`,
2114
- );
2115
- }
2116
-
2117
- /** @internal */
2118
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Boolean$inboundSchema:
2119
- z.ZodType<
2120
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Boolean,
2121
- z.ZodTypeDef,
2122
- unknown
2123
- > = z.object({
2124
- enabled: z.boolean().default(true),
2125
- alert_on_failure: z.boolean().default(false),
2126
- type: z.literal("boolean"),
2127
- value: z.boolean(),
2128
- }).transform((v) => {
2129
- return remap$(v, {
2130
- "alert_on_failure": "alertOnFailure",
2131
- });
2132
- });
2133
-
2134
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7BooleanFromJSON(
2135
- jsonString: string,
2136
- ): SafeParseResult<
2137
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Boolean,
2138
- SDKValidationError
2139
- > {
2140
- return safeParse(
2141
- jsonString,
2142
- (x) =>
2143
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Boolean$inboundSchema
2144
- .parse(JSON.parse(x)),
2145
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Boolean' from JSON`,
2146
- );
2147
- }
2148
-
2149
- /** @internal */
2150
- export const CreateEvalResponseBodyEvalsResponse200ApplicationJSONGuardrailConfig$inboundSchema:
2151
- z.ZodType<
2152
- CreateEvalResponseBodyEvalsResponse200ApplicationJSONGuardrailConfig,
2153
- z.ZodTypeDef,
2154
- unknown
2155
- > = z.union([
2156
- z.lazy(() =>
2157
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Boolean$inboundSchema
2158
- ),
2159
- z.lazy(() =>
2160
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Categorical$inboundSchema
2161
- ),
2162
- z.lazy(() =>
2163
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Number$inboundSchema
2164
- ),
2165
- ]);
2166
-
2167
- export function createEvalResponseBodyEvalsResponse200ApplicationJSONGuardrailConfigFromJSON(
2168
- jsonString: string,
2169
- ): SafeParseResult<
2170
- CreateEvalResponseBodyEvalsResponse200ApplicationJSONGuardrailConfig,
2171
- SDKValidationError
2172
- > {
2173
- return safeParse(
2174
- jsonString,
2175
- (x) =>
2176
- CreateEvalResponseBodyEvalsResponse200ApplicationJSONGuardrailConfig$inboundSchema
2177
- .parse(JSON.parse(x)),
2178
- `Failed to parse 'CreateEvalResponseBodyEvalsResponse200ApplicationJSONGuardrailConfig' from JSON`,
2179
- );
2180
- }
2181
-
2182
- /** @internal */
2183
- export const CreateEvalResponseBodyEvalsResponse200ApplicationJSONType$inboundSchema:
2184
- z.ZodNativeEnum<
2185
- typeof CreateEvalResponseBodyEvalsResponse200ApplicationJSONType
2186
- > = z.nativeEnum(CreateEvalResponseBodyEvalsResponse200ApplicationJSONType);
2187
-
2188
- /** @internal */
2189
- export const Typescript$inboundSchema: z.ZodType<
2190
- Typescript,
2191
- z.ZodTypeDef,
2192
- unknown
2193
- > = z.object({
2194
- _id: z.string(),
2195
- description: z.string(),
2196
- created: z.string().default("2026-06-26T19:19:38.900Z"),
2197
- updated: z.string().default("2026-06-26T19:19:38.900Z"),
2198
- updated_by_id: z.nullable(z.string()).optional(),
2199
- guardrail_config: z.nullable(
2200
- z.union([
2201
- z.lazy(() =>
2202
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Boolean$inboundSchema
2203
- ),
2204
- z.lazy(() =>
2205
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Categorical$inboundSchema
2206
- ),
2207
- z.lazy(() =>
2208
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody7Number$inboundSchema
2209
- ),
2210
- ]),
2211
- ).optional(),
2212
- code: z.string(),
2213
- type: CreateEvalResponseBodyEvalsResponse200ApplicationJSONType$inboundSchema,
2214
- key: z.string(),
2215
- }).transform((v) => {
2216
- return remap$(v, {
2217
- "_id": "id",
2218
- "updated_by_id": "updatedById",
2219
- "guardrail_config": "guardrailConfig",
2220
- });
2221
- });
2222
-
2223
- export function typescriptFromJSON(
2224
- jsonString: string,
2225
- ): SafeParseResult<Typescript, SDKValidationError> {
2226
- return safeParse(
2227
- jsonString,
2228
- (x) => Typescript$inboundSchema.parse(JSON.parse(x)),
2229
- `Failed to parse 'Typescript' from JSON`,
2230
- );
2231
- }
2232
-
2233
- /** @internal */
2234
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyOperator$inboundSchema:
2235
- z.ZodNativeEnum<
2236
- typeof CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyOperator
2237
- > = z.nativeEnum(
2238
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyOperator,
2239
- );
2240
-
2241
- /** @internal */
2242
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber$inboundSchema:
2243
- z.ZodType<
2244
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber,
2245
- z.ZodTypeDef,
2246
- unknown
2247
- > = z.object({
2248
- enabled: z.boolean().default(true),
2249
- alert_on_failure: z.boolean().default(false),
2250
- type: z.literal("number"),
2251
- value: z.number(),
2252
- operator:
2253
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyOperator$inboundSchema,
2254
- }).transform((v) => {
2255
- return remap$(v, {
2256
- "alert_on_failure": "alertOnFailure",
2257
- });
2258
- });
2259
-
2260
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumberFromJSON(
2261
- jsonString: string,
2262
- ): SafeParseResult<
2263
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber,
2264
- SDKValidationError
2265
- > {
2266
- return safeParse(
2267
- jsonString,
2268
- (x) =>
2269
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber$inboundSchema
2270
- .parse(JSON.parse(x)),
2271
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber' from JSON`,
2272
- );
2273
- }
2274
-
2275
- /** @internal */
2276
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyCategorical$inboundSchema:
2277
- z.ZodType<
2278
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyCategorical,
2279
- z.ZodTypeDef,
2280
- unknown
2281
- > = z.object({
2282
- enabled: z.boolean().default(true),
2283
- alert_on_failure: z.boolean().default(false),
2284
- type: z.literal("categorical"),
2285
- values: z.array(z.string()),
2286
- }).transform((v) => {
2287
- return remap$(v, {
2288
- "alert_on_failure": "alertOnFailure",
2289
- });
2290
- });
2291
-
2292
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyCategoricalFromJSON(
2293
- jsonString: string,
2294
- ): SafeParseResult<
2295
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyCategorical,
2296
- SDKValidationError
2297
- > {
2298
- return safeParse(
2299
- jsonString,
2300
- (x) =>
2301
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyCategorical$inboundSchema
2302
- .parse(JSON.parse(x)),
2303
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyCategorical' from JSON`,
2304
- );
2305
- }
2306
-
2307
- /** @internal */
2308
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyBoolean$inboundSchema:
2309
- z.ZodType<
2310
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyBoolean,
2311
- z.ZodTypeDef,
2312
- unknown
2313
- > = z.object({
2314
- enabled: z.boolean().default(true),
2315
- alert_on_failure: z.boolean().default(false),
2316
- type: z.literal("boolean"),
2317
- value: z.boolean(),
2318
- }).transform((v) => {
2319
- return remap$(v, {
2320
- "alert_on_failure": "alertOnFailure",
2321
- });
2322
- });
2323
-
2324
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyBooleanFromJSON(
2325
- jsonString: string,
2326
- ): SafeParseResult<
2327
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyBoolean,
2328
- SDKValidationError
2329
- > {
2330
- return safeParse(
2331
- jsonString,
2332
- (x) =>
2333
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyBoolean$inboundSchema
2334
- .parse(JSON.parse(x)),
2335
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyBoolean' from JSON`,
2336
- );
2337
- }
2338
-
2339
- /** @internal */
2340
- export const CreateEvalResponseBodyEvalsResponse200GuardrailConfig$inboundSchema:
2341
- z.ZodType<
2342
- CreateEvalResponseBodyEvalsResponse200GuardrailConfig,
2343
- z.ZodTypeDef,
2344
- unknown
2345
- > = z.union([
2346
- z.lazy(() =>
2347
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyBoolean$inboundSchema
2348
- ),
2349
- z.lazy(() =>
2350
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyCategorical$inboundSchema
2351
- ),
2352
- z.lazy(() =>
2353
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber$inboundSchema
2354
- ),
2355
- ]);
2356
-
2357
- export function createEvalResponseBodyEvalsResponse200GuardrailConfigFromJSON(
2358
- jsonString: string,
2359
- ): SafeParseResult<
2360
- CreateEvalResponseBodyEvalsResponse200GuardrailConfig,
2361
- SDKValidationError
2362
- > {
2363
- return safeParse(
2364
- jsonString,
2365
- (x) =>
2366
- CreateEvalResponseBodyEvalsResponse200GuardrailConfig$inboundSchema.parse(
2367
- JSON.parse(x),
2368
- ),
2369
- `Failed to parse 'CreateEvalResponseBodyEvalsResponse200GuardrailConfig' from JSON`,
2370
- );
2371
- }
2372
-
2373
- /** @internal */
2374
- export const CreateEvalResponseBodyEvalsResponse200Type$inboundSchema:
2375
- z.ZodNativeEnum<typeof CreateEvalResponseBodyEvalsResponse200Type> = z
2376
- .nativeEnum(CreateEvalResponseBodyEvalsResponse200Type);
2377
-
2378
- /** @internal */
2379
- export const RagasMetric$inboundSchema: z.ZodNativeEnum<typeof RagasMetric> = z
2380
- .nativeEnum(RagasMetric);
2381
-
2382
- /** @internal */
2383
- export const Ragas$inboundSchema: z.ZodType<Ragas, z.ZodTypeDef, unknown> = z
2384
- .object({
2385
- _id: z.string(),
2386
- description: z.string(),
2387
- created: z.string().default("2026-06-26T19:19:38.900Z"),
2388
- updated: z.string().default("2026-06-26T19:19:38.900Z"),
2389
- updated_by_id: z.nullable(z.string()).optional(),
2390
- guardrail_config: z.nullable(
2391
- z.union([
2392
- z.lazy(() =>
2393
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyBoolean$inboundSchema
2394
- ),
2395
- z.lazy(() =>
2396
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyCategorical$inboundSchema
2397
- ),
2398
- z.lazy(() =>
2399
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBodyNumber$inboundSchema
2400
- ),
2401
- ]),
2402
- ).optional(),
2403
- type: CreateEvalResponseBodyEvalsResponse200Type$inboundSchema,
2404
- ragas_metric: RagasMetric$inboundSchema,
2405
- key: z.string(),
2406
- model: z.string(),
2407
- }).transform((v) => {
2408
- return remap$(v, {
2409
- "_id": "id",
2410
- "updated_by_id": "updatedById",
2411
- "guardrail_config": "guardrailConfig",
2412
- "ragas_metric": "ragasMetric",
2413
- });
2414
- });
2415
-
2416
- export function ragasFromJSON(
2417
- jsonString: string,
2418
- ): SafeParseResult<Ragas, SDKValidationError> {
2419
- return safeParse(
2420
- jsonString,
2421
- (x) => Ragas$inboundSchema.parse(JSON.parse(x)),
2422
- `Failed to parse 'Ragas' from JSON`,
2423
- );
2424
- }
2425
-
2426
- /** @internal */
2427
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONOperator$inboundSchema:
2428
- z.ZodNativeEnum<
2429
- typeof CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONOperator
2430
- > = z.nativeEnum(
2431
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONOperator,
2432
- );
2433
-
2434
- /** @internal */
2435
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber$inboundSchema:
2436
- z.ZodType<
2437
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber,
2438
- z.ZodTypeDef,
2439
- unknown
2440
- > = z.object({
2441
- enabled: z.boolean().default(true),
2442
- alert_on_failure: z.boolean().default(false),
2443
- type: z.literal("number"),
2444
- value: z.number(),
2445
- operator:
2446
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONOperator$inboundSchema,
2447
- }).transform((v) => {
2448
- return remap$(v, {
2449
- "alert_on_failure": "alertOnFailure",
2450
- });
2451
- });
2452
-
2453
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONNumberFromJSON(
2454
- jsonString: string,
2455
- ): SafeParseResult<
2456
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber,
2457
- SDKValidationError
2458
- > {
2459
- return safeParse(
2460
- jsonString,
2461
- (x) =>
2462
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber$inboundSchema
2463
- .parse(JSON.parse(x)),
2464
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber' from JSON`,
2465
- );
2466
- }
2467
-
2468
- /** @internal */
2469
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONCategorical$inboundSchema:
2470
- z.ZodType<
2471
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONCategorical,
2472
- z.ZodTypeDef,
2473
- unknown
2474
- > = z.object({
2475
- enabled: z.boolean().default(true),
2476
- alert_on_failure: z.boolean().default(false),
2477
- type: z.literal("categorical"),
2478
- values: z.array(z.string()),
2479
- }).transform((v) => {
2480
- return remap$(v, {
2481
- "alert_on_failure": "alertOnFailure",
2482
- });
2483
- });
2484
-
2485
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONCategoricalFromJSON(
2486
- jsonString: string,
2487
- ): SafeParseResult<
2488
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONCategorical,
2489
- SDKValidationError
2490
- > {
2491
- return safeParse(
2492
- jsonString,
2493
- (x) =>
2494
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONCategorical$inboundSchema
2495
- .parse(JSON.parse(x)),
2496
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONCategorical' from JSON`,
2497
- );
2498
- }
2499
-
2500
- /** @internal */
2501
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONBoolean$inboundSchema:
2502
- z.ZodType<
2503
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONBoolean,
2504
- z.ZodTypeDef,
2505
- unknown
2506
- > = z.object({
2507
- enabled: z.boolean().default(true),
2508
- alert_on_failure: z.boolean().default(false),
2509
- type: z.literal("boolean"),
2510
- value: z.boolean(),
2511
- }).transform((v) => {
2512
- return remap$(v, {
2513
- "alert_on_failure": "alertOnFailure",
2514
- });
2515
- });
2516
-
2517
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONBooleanFromJSON(
2518
- jsonString: string,
2519
- ): SafeParseResult<
2520
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONBoolean,
2521
- SDKValidationError
2522
- > {
2523
- return safeParse(
2524
- jsonString,
2525
- (x) =>
2526
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONBoolean$inboundSchema
2527
- .parse(JSON.parse(x)),
2528
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONBoolean' from JSON`,
2529
- );
2530
- }
2531
-
2532
- /** @internal */
2533
- export const CreateEvalResponseBodyEvalsResponseGuardrailConfig$inboundSchema:
2534
- z.ZodType<
2535
- CreateEvalResponseBodyEvalsResponseGuardrailConfig,
2536
- z.ZodTypeDef,
2537
- unknown
2538
- > = z.union([
2539
- z.lazy(() =>
2540
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONBoolean$inboundSchema
2541
- ),
2542
- z.lazy(() =>
2543
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONCategorical$inboundSchema
2544
- ),
2545
- z.lazy(() =>
2546
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber$inboundSchema
2547
- ),
2548
- ]);
2549
-
2550
- export function createEvalResponseBodyEvalsResponseGuardrailConfigFromJSON(
2551
- jsonString: string,
2552
- ): SafeParseResult<
2553
- CreateEvalResponseBodyEvalsResponseGuardrailConfig,
2554
- SDKValidationError
2555
- > {
2556
- return safeParse(
2557
- jsonString,
2558
- (x) =>
2559
- CreateEvalResponseBodyEvalsResponseGuardrailConfig$inboundSchema.parse(
2560
- JSON.parse(x),
2561
- ),
2562
- `Failed to parse 'CreateEvalResponseBodyEvalsResponseGuardrailConfig' from JSON`,
2563
- );
2564
- }
2565
-
2566
- /** @internal */
2567
- export const CreateEvalResponseBodyEvalsResponseType$inboundSchema:
2568
- z.ZodNativeEnum<typeof CreateEvalResponseBodyEvalsResponseType> = z
2569
- .nativeEnum(CreateEvalResponseBodyEvalsResponseType);
2570
-
2571
- /** @internal */
2572
- export const ThirtyTwo$inboundSchema: z.ZodType<
2573
- ThirtyTwo,
2574
- z.ZodTypeDef,
2575
- unknown
2576
- > = z.object({
2577
- type: z.literal("grammar_diversity"),
2578
- });
2579
-
2580
- export function thirtyTwoFromJSON(
2581
- jsonString: string,
2582
- ): SafeParseResult<ThirtyTwo, SDKValidationError> {
2583
- return safeParse(
2584
- jsonString,
2585
- (x) => ThirtyTwo$inboundSchema.parse(JSON.parse(x)),
2586
- `Failed to parse 'ThirtyTwo' from JSON`,
2587
- );
2588
- }
2589
-
2590
- /** @internal */
2591
- export const ThirtyOne$inboundSchema: z.ZodType<
2592
- ThirtyOne,
2593
- z.ZodTypeDef,
2594
- unknown
2595
- > = z.object({
2596
- type: z.literal("lexical_repetition"),
2597
- });
2598
-
2599
- export function thirtyOneFromJSON(
2600
- jsonString: string,
2601
- ): SafeParseResult<ThirtyOne, SDKValidationError> {
2602
- return safeParse(
2603
- jsonString,
2604
- (x) => ThirtyOne$inboundSchema.parse(JSON.parse(x)),
2605
- `Failed to parse 'ThirtyOne' from JSON`,
2606
- );
2607
- }
2608
-
2609
- /** @internal */
2610
- export const Thirty$inboundSchema: z.ZodType<Thirty, z.ZodTypeDef, unknown> = z
2611
- .object({
2612
- type: z.literal("sentences_count"),
2613
- });
2614
-
2615
- export function thirtyFromJSON(
2616
- jsonString: string,
2617
- ): SafeParseResult<Thirty, SDKValidationError> {
2618
- return safeParse(
2619
- jsonString,
2620
- (x) => Thirty$inboundSchema.parse(JSON.parse(x)),
2621
- `Failed to parse 'Thirty' from JSON`,
2622
- );
2623
- }
2624
-
2625
- /** @internal */
2626
- export const TwentyNine$inboundSchema: z.ZodType<
2627
- TwentyNine,
2628
- z.ZodTypeDef,
2629
- unknown
2630
- > = z.object({
2631
- type: z.literal("words_count"),
2632
- });
2633
-
2634
- export function twentyNineFromJSON(
2635
- jsonString: string,
2636
- ): SafeParseResult<TwentyNine, SDKValidationError> {
2637
- return safeParse(
2638
- jsonString,
2639
- (x) => TwentyNine$inboundSchema.parse(JSON.parse(x)),
2640
- `Failed to parse 'TwentyNine' from JSON`,
2641
- );
2642
- }
2643
-
2644
- /** @internal */
2645
- export const TwentyEight$inboundSchema: z.ZodType<
2646
- TwentyEight,
2647
- z.ZodTypeDef,
2648
- unknown
2649
- > = z.object({
2650
- type: z.literal("gse_english_level"),
2651
- });
2652
-
2653
- export function twentyEightFromJSON(
2654
- jsonString: string,
2655
- ): SafeParseResult<TwentyEight, SDKValidationError> {
2656
- return safeParse(
2657
- jsonString,
2658
- (x) => TwentyEight$inboundSchema.parse(JSON.parse(x)),
2659
- `Failed to parse 'TwentyEight' from JSON`,
2660
- );
2661
- }
2662
-
2663
- /** @internal */
2664
- export const TwentySeven$inboundSchema: z.ZodType<
2665
- TwentySeven,
2666
- z.ZodTypeDef,
2667
- unknown
2668
- > = z.object({
2669
- type: z.literal("flesch_reading_ease"),
2670
- });
2671
-
2672
- export function twentySevenFromJSON(
2673
- jsonString: string,
2674
- ): SafeParseResult<TwentySeven, SDKValidationError> {
2675
- return safeParse(
2676
- jsonString,
2677
- (x) => TwentySeven$inboundSchema.parse(JSON.parse(x)),
2678
- `Failed to parse 'TwentySeven' from JSON`,
2679
- );
2680
- }
2681
-
2682
- /** @internal */
2683
- export const TwentySix$inboundSchema: z.ZodType<
2684
- TwentySix,
2685
- z.ZodTypeDef,
2686
- unknown
2687
- > = z.object({
2688
- type: z.literal("most_repeated_words"),
2689
- });
2690
-
2691
- export function twentySixFromJSON(
2692
- jsonString: string,
2693
- ): SafeParseResult<TwentySix, SDKValidationError> {
2694
- return safeParse(
2695
- jsonString,
2696
- (x) => TwentySix$inboundSchema.parse(JSON.parse(x)),
2697
- `Failed to parse 'TwentySix' from JSON`,
2698
- );
2699
- }
2700
-
2701
- /** @internal */
2702
- export const TwentyFive$inboundSchema: z.ZodType<
2703
- TwentyFive,
2704
- z.ZodTypeDef,
2705
- unknown
2706
- > = z.object({
2707
- type: z.literal("keywords_match"),
2708
- keywords: z.array(z.string()),
2709
- });
2710
-
2711
- export function twentyFiveFromJSON(
2712
- jsonString: string,
2713
- ): SafeParseResult<TwentyFive, SDKValidationError> {
2714
- return safeParse(
2715
- jsonString,
2716
- (x) => TwentyFive$inboundSchema.parse(JSON.parse(x)),
2717
- `Failed to parse 'TwentyFive' from JSON`,
2718
- );
2719
- }
2720
-
2721
- /** @internal */
2722
- export const TwentyFour$inboundSchema: z.ZodType<
2723
- TwentyFour,
2724
- z.ZodTypeDef,
2725
- unknown
2726
- > = z.object({
2727
- type: z.literal("levenshtein_distance"),
2728
- });
2729
-
2730
- export function twentyFourFromJSON(
2731
- jsonString: string,
2732
- ): SafeParseResult<TwentyFour, SDKValidationError> {
2733
- return safeParse(
2734
- jsonString,
2735
- (x) => TwentyFour$inboundSchema.parse(JSON.parse(x)),
2736
- `Failed to parse 'TwentyFour' from JSON`,
2737
- );
2738
- }
2739
-
2740
- /** @internal */
2741
- export const TwentyThree$inboundSchema: z.ZodType<
2742
- TwentyThree,
2743
- z.ZodTypeDef,
2744
- unknown
2745
- > = z.object({
2746
- type: z.literal("cosine_similarity"),
2747
- });
2748
-
2749
- export function twentyThreeFromJSON(
2750
- jsonString: string,
2751
- ): SafeParseResult<TwentyThree, SDKValidationError> {
2752
- return safeParse(
2753
- jsonString,
2754
- (x) => TwentyThree$inboundSchema.parse(JSON.parse(x)),
2755
- `Failed to parse 'TwentyThree' from JSON`,
2756
- );
2757
- }
2758
-
2759
- /** @internal */
2760
- export const TwentyTwo$inboundSchema: z.ZodType<
2761
- TwentyTwo,
2762
- z.ZodTypeDef,
2763
- unknown
2764
- > = z.object({
2765
- type: z.literal("meteor_score"),
2766
- });
2767
-
2768
- export function twentyTwoFromJSON(
2769
- jsonString: string,
2770
- ): SafeParseResult<TwentyTwo, SDKValidationError> {
2771
- return safeParse(
2772
- jsonString,
2773
- (x) => TwentyTwo$inboundSchema.parse(JSON.parse(x)),
2774
- `Failed to parse 'TwentyTwo' from JSON`,
2775
- );
2776
- }
2777
-
2778
- /** @internal */
2779
- export const TwentyOne$inboundSchema: z.ZodType<
2780
- TwentyOne,
2781
- z.ZodTypeDef,
2782
- unknown
2783
- > = z.object({
2784
- type: z.literal("rouge_n"),
2785
- });
2786
-
2787
- export function twentyOneFromJSON(
2788
- jsonString: string,
2789
- ): SafeParseResult<TwentyOne, SDKValidationError> {
2790
- return safeParse(
2791
- jsonString,
2792
- (x) => TwentyOne$inboundSchema.parse(JSON.parse(x)),
2793
- `Failed to parse 'TwentyOne' from JSON`,
2794
- );
2795
- }
2796
-
2797
- /** @internal */
2798
- export const Twenty$inboundSchema: z.ZodType<Twenty, z.ZodTypeDef, unknown> = z
2799
- .object({
2800
- type: z.literal("bleu_score"),
2801
- });
2802
-
2803
- export function twentyFromJSON(
2804
- jsonString: string,
2805
- ): SafeParseResult<Twenty, SDKValidationError> {
2806
- return safeParse(
2807
- jsonString,
2808
- (x) => Twenty$inboundSchema.parse(JSON.parse(x)),
2809
- `Failed to parse 'Twenty' from JSON`,
2810
- );
2811
- }
2812
-
2813
- /** @internal */
2814
- export const Nineteen$inboundSchema: z.ZodType<
2815
- Nineteen,
2816
- z.ZodTypeDef,
2817
- unknown
2818
- > = z.object({
2819
- type: z.literal("bert_score"),
2820
- });
2821
-
2822
- export function nineteenFromJSON(
2823
- jsonString: string,
2824
- ): SafeParseResult<Nineteen, SDKValidationError> {
2825
- return safeParse(
2826
- jsonString,
2827
- (x) => Nineteen$inboundSchema.parse(JSON.parse(x)),
2828
- `Failed to parse 'Nineteen' from JSON`,
2829
- );
2830
- }
2831
-
2832
- /** @internal */
2833
- export const Eighteen$inboundSchema: z.ZodType<
2834
- Eighteen,
2835
- z.ZodTypeDef,
2836
- unknown
2837
- > = z.object({
2838
- type: z.literal("moderations_google"),
2839
- });
2840
-
2841
- export function eighteenFromJSON(
2842
- jsonString: string,
2843
- ): SafeParseResult<Eighteen, SDKValidationError> {
2844
- return safeParse(
2845
- jsonString,
2846
- (x) => Eighteen$inboundSchema.parse(JSON.parse(x)),
2847
- `Failed to parse 'Eighteen' from JSON`,
2848
- );
2849
- }
2850
-
2851
- /** @internal */
2852
- export const Seventeen$inboundSchema: z.ZodType<
2853
- Seventeen,
2854
- z.ZodTypeDef,
2855
- unknown
2856
- > = z.object({
2857
- type: z.literal("moderations_openai"),
2858
- });
2859
-
2860
- export function seventeenFromJSON(
2861
- jsonString: string,
2862
- ): SafeParseResult<Seventeen, SDKValidationError> {
2863
- return safeParse(
2864
- jsonString,
2865
- (x) => Seventeen$inboundSchema.parse(JSON.parse(x)),
2866
- `Failed to parse 'Seventeen' from JSON`,
2867
- );
2868
- }
2869
-
2870
- /** @internal */
2871
- export const Sixteen$inboundSchema: z.ZodType<Sixteen, z.ZodTypeDef, unknown> =
2872
- z.object({
2873
- type: z.literal("is_valid_json"),
2874
- });
2875
-
2876
- export function sixteenFromJSON(
2877
- jsonString: string,
2878
- ): SafeParseResult<Sixteen, SDKValidationError> {
2879
- return safeParse(
2880
- jsonString,
2881
- (x) => Sixteen$inboundSchema.parse(JSON.parse(x)),
2882
- `Failed to parse 'Sixteen' from JSON`,
2883
- );
2884
- }
2885
-
2886
- /** @internal */
2887
- export const Fifteen$inboundSchema: z.ZodType<Fifteen, z.ZodTypeDef, unknown> =
2888
- z.object({
2889
- type: z.literal("regex"),
2890
- pattern: z.string(),
2891
- });
2892
-
2893
- export function fifteenFromJSON(
2894
- jsonString: string,
2895
- ): SafeParseResult<Fifteen, SDKValidationError> {
2896
- return safeParse(
2897
- jsonString,
2898
- (x) => Fifteen$inboundSchema.parse(JSON.parse(x)),
2899
- `Failed to parse 'Fifteen' from JSON`,
2900
- );
2901
- }
2902
-
2903
- /** @internal */
2904
- export const Fourteen$inboundSchema: z.ZodType<
2905
- Fourteen,
2906
- z.ZodTypeDef,
2907
- unknown
2908
- > = z.object({
2909
- type: z.literal("one_line"),
2910
- });
2911
-
2912
- export function fourteenFromJSON(
2913
- jsonString: string,
2914
- ): SafeParseResult<Fourteen, SDKValidationError> {
2915
- return safeParse(
2916
- jsonString,
2917
- (x) => Fourteen$inboundSchema.parse(JSON.parse(x)),
2918
- `Failed to parse 'Fourteen' from JSON`,
2919
- );
2920
- }
2921
-
2922
- /** @internal */
2923
- export const Thirteen$inboundSchema: z.ZodType<
2924
- Thirteen,
2925
- z.ZodTypeDef,
2926
- unknown
2927
- > = z.object({
2928
- type: z.literal("length_greater_than"),
2929
- value: z.number(),
2930
- });
2931
-
2932
- export function thirteenFromJSON(
2933
- jsonString: string,
2934
- ): SafeParseResult<Thirteen, SDKValidationError> {
2935
- return safeParse(
2936
- jsonString,
2937
- (x) => Thirteen$inboundSchema.parse(JSON.parse(x)),
2938
- `Failed to parse 'Thirteen' from JSON`,
2939
- );
2940
- }
2941
-
2942
- /** @internal */
2943
- export const Twelve$inboundSchema: z.ZodType<Twelve, z.ZodTypeDef, unknown> = z
2944
- .object({
2945
- type: z.literal("length_between"),
2946
- min: z.number(),
2947
- max: z.number(),
2948
- });
2949
-
2950
- export function twelveFromJSON(
2951
- jsonString: string,
2952
- ): SafeParseResult<Twelve, SDKValidationError> {
2953
- return safeParse(
2954
- jsonString,
2955
- (x) => Twelve$inboundSchema.parse(JSON.parse(x)),
2956
- `Failed to parse 'Twelve' from JSON`,
2957
- );
2958
- }
2959
-
2960
- /** @internal */
2961
- export const Eleven$inboundSchema: z.ZodType<Eleven, z.ZodTypeDef, unknown> = z
2962
- .object({
2963
- type: z.literal("length_less_than"),
2964
- value: z.number(),
2965
- });
2966
-
2967
- export function elevenFromJSON(
2968
- jsonString: string,
2969
- ): SafeParseResult<Eleven, SDKValidationError> {
2970
- return safeParse(
2971
- jsonString,
2972
- (x) => Eleven$inboundSchema.parse(JSON.parse(x)),
2973
- `Failed to parse 'Eleven' from JSON`,
2974
- );
2975
- }
2976
-
2977
- /** @internal */
2978
- export const Ten$inboundSchema: z.ZodType<Ten, z.ZodTypeDef, unknown> = z
2979
- .object({
2980
- type: z.literal("exact_match"),
2981
- });
2982
-
2983
- export function tenFromJSON(
2984
- jsonString: string,
2985
- ): SafeParseResult<Ten, SDKValidationError> {
2986
- return safeParse(
2987
- jsonString,
2988
- (x) => Ten$inboundSchema.parse(JSON.parse(x)),
2989
- `Failed to parse 'Ten' from JSON`,
2990
- );
2991
- }
2992
-
2993
- /** @internal */
2994
- export const Nine$inboundSchema: z.ZodType<Nine, z.ZodTypeDef, unknown> = z
2995
- .object({
2996
- type: z.literal("ends_with"),
2997
- value: z.string(),
2998
- });
2999
-
3000
- export function nineFromJSON(
3001
- jsonString: string,
3002
- ): SafeParseResult<Nine, SDKValidationError> {
3003
- return safeParse(
3004
- jsonString,
3005
- (x) => Nine$inboundSchema.parse(JSON.parse(x)),
3006
- `Failed to parse 'Nine' from JSON`,
3007
- );
3008
- }
3009
-
3010
- /** @internal */
3011
- export const Eight$inboundSchema: z.ZodType<Eight, z.ZodTypeDef, unknown> = z
3012
- .object({
3013
- type: z.literal("start_with"),
3014
- value: z.string(),
3015
- });
3016
-
3017
- export function eightFromJSON(
3018
- jsonString: string,
3019
- ): SafeParseResult<Eight, SDKValidationError> {
3020
- return safeParse(
3021
- jsonString,
3022
- (x) => Eight$inboundSchema.parse(JSON.parse(x)),
3023
- `Failed to parse 'Eight' from JSON`,
3024
- );
3025
- }
3026
-
3027
- /** @internal */
3028
- export const Seven$inboundSchema: z.ZodType<Seven, z.ZodTypeDef, unknown> = z
3029
- .object({
3030
- type: z.literal("contains_valid_link"),
3031
- });
3032
-
3033
- export function sevenFromJSON(
3034
- jsonString: string,
3035
- ): SafeParseResult<Seven, SDKValidationError> {
3036
- return safeParse(
3037
- jsonString,
3038
- (x) => Seven$inboundSchema.parse(JSON.parse(x)),
3039
- `Failed to parse 'Seven' from JSON`,
3040
- );
3041
- }
3042
-
3043
- /** @internal */
3044
- export const Six$inboundSchema: z.ZodType<Six, z.ZodTypeDef, unknown> = z
3045
- .object({
3046
- type: z.literal("contains_url"),
3047
- });
3048
-
3049
- export function sixFromJSON(
3050
- jsonString: string,
3051
- ): SafeParseResult<Six, SDKValidationError> {
3052
- return safeParse(
3053
- jsonString,
3054
- (x) => Six$inboundSchema.parse(JSON.parse(x)),
3055
- `Failed to parse 'Six' from JSON`,
3056
- );
3057
- }
3058
-
3059
- /** @internal */
3060
- export const Five$inboundSchema: z.ZodType<Five, z.ZodTypeDef, unknown> = z
3061
- .object({
3062
- type: z.literal("contains_email"),
3063
- });
3064
-
3065
- export function fiveFromJSON(
3066
- jsonString: string,
3067
- ): SafeParseResult<Five, SDKValidationError> {
3068
- return safeParse(
3069
- jsonString,
3070
- (x) => Five$inboundSchema.parse(JSON.parse(x)),
3071
- `Failed to parse 'Five' from JSON`,
3072
- );
3073
- }
3074
-
3075
- /** @internal */
3076
- export const CreateEvalFunctionParams4$inboundSchema: z.ZodType<
3077
- CreateEvalFunctionParams4,
3078
- z.ZodTypeDef,
3079
- unknown
3080
- > = z.object({
3081
- type: z.literal("contains_any"),
3082
- keywords: z.array(z.string()),
3083
- });
3084
-
3085
- export function createEvalFunctionParams4FromJSON(
3086
- jsonString: string,
3087
- ): SafeParseResult<CreateEvalFunctionParams4, SDKValidationError> {
3088
- return safeParse(
3089
- jsonString,
3090
- (x) => CreateEvalFunctionParams4$inboundSchema.parse(JSON.parse(x)),
3091
- `Failed to parse 'CreateEvalFunctionParams4' from JSON`,
3092
- );
3093
- }
3094
-
3095
- /** @internal */
3096
- export const CreateEvalFunctionParams3$inboundSchema: z.ZodType<
3097
- CreateEvalFunctionParams3,
3098
- z.ZodTypeDef,
3099
- unknown
3100
- > = z.object({
3101
- type: z.literal("contains_all"),
3102
- keywords: z.array(z.string()),
3103
- });
3104
-
3105
- export function createEvalFunctionParams3FromJSON(
3106
- jsonString: string,
3107
- ): SafeParseResult<CreateEvalFunctionParams3, SDKValidationError> {
3108
- return safeParse(
3109
- jsonString,
3110
- (x) => CreateEvalFunctionParams3$inboundSchema.parse(JSON.parse(x)),
3111
- `Failed to parse 'CreateEvalFunctionParams3' from JSON`,
3112
- );
3113
- }
3114
-
3115
- /** @internal */
3116
- export const FunctionParams2$inboundSchema: z.ZodType<
3117
- FunctionParams2,
3118
- z.ZodTypeDef,
3119
- unknown
3120
- > = z.object({
3121
- type: z.literal("contains_none"),
3122
- keywords: z.array(z.string()),
3123
- });
3124
-
3125
- export function functionParams2FromJSON(
3126
- jsonString: string,
3127
- ): SafeParseResult<FunctionParams2, SDKValidationError> {
3128
- return safeParse(
3129
- jsonString,
3130
- (x) => FunctionParams2$inboundSchema.parse(JSON.parse(x)),
3131
- `Failed to parse 'FunctionParams2' from JSON`,
3132
- );
3133
- }
3134
-
3135
- /** @internal */
3136
- export const FunctionParams1$inboundSchema: z.ZodType<
3137
- FunctionParams1,
3138
- z.ZodTypeDef,
3139
- unknown
3140
- > = z.object({
3141
- type: z.literal("contains"),
3142
- value: z.string(),
3143
- });
3144
-
3145
- export function functionParams1FromJSON(
3146
- jsonString: string,
3147
- ): SafeParseResult<FunctionParams1, SDKValidationError> {
3148
- return safeParse(
3149
- jsonString,
3150
- (x) => FunctionParams1$inboundSchema.parse(JSON.parse(x)),
3151
- `Failed to parse 'FunctionParams1' from JSON`,
3152
- );
3153
- }
3154
-
3155
- /** @internal */
3156
- export const FunctionParams$inboundSchema: z.ZodType<
3157
- FunctionParams,
3158
- z.ZodTypeDef,
3159
- unknown
3160
- > = z.union([
3161
- z.lazy(() => FunctionParams1$inboundSchema),
3162
- z.lazy(() => FunctionParams2$inboundSchema),
3163
- z.lazy(() => CreateEvalFunctionParams3$inboundSchema),
3164
- z.lazy(() => CreateEvalFunctionParams4$inboundSchema),
3165
- z.lazy(() => Five$inboundSchema),
3166
- z.lazy(() => Six$inboundSchema),
3167
- z.lazy(() => Seven$inboundSchema),
3168
- z.lazy(() => Eight$inboundSchema),
3169
- z.lazy(() => Nine$inboundSchema),
3170
- z.lazy(() => Ten$inboundSchema),
3171
- z.lazy(() => Eleven$inboundSchema),
3172
- z.lazy(() => Twelve$inboundSchema),
3173
- z.lazy(() => Thirteen$inboundSchema),
3174
- z.lazy(() => Fourteen$inboundSchema),
3175
- z.lazy(() => Fifteen$inboundSchema),
3176
- z.lazy(() => Sixteen$inboundSchema),
3177
- z.lazy(() => Seventeen$inboundSchema),
3178
- z.lazy(() => Eighteen$inboundSchema),
3179
- z.lazy(() => Nineteen$inboundSchema),
3180
- z.lazy(() => Twenty$inboundSchema),
3181
- z.lazy(() => TwentyOne$inboundSchema),
3182
- z.lazy(() => TwentyTwo$inboundSchema),
3183
- z.lazy(() => TwentyThree$inboundSchema),
3184
- z.lazy(() => TwentyFour$inboundSchema),
3185
- z.lazy(() => TwentyFive$inboundSchema),
3186
- z.lazy(() => TwentySix$inboundSchema),
3187
- z.lazy(() => TwentySeven$inboundSchema),
3188
- z.lazy(() => TwentyEight$inboundSchema),
3189
- z.lazy(() => TwentyNine$inboundSchema),
3190
- z.lazy(() => Thirty$inboundSchema),
3191
- z.lazy(() => ThirtyOne$inboundSchema),
3192
- z.lazy(() => ThirtyTwo$inboundSchema),
3193
- ]);
3194
-
3195
- export function functionParamsFromJSON(
3196
- jsonString: string,
3197
- ): SafeParseResult<FunctionParams, SDKValidationError> {
3198
- return safeParse(
3199
- jsonString,
3200
- (x) => FunctionParams$inboundSchema.parse(JSON.parse(x)),
3201
- `Failed to parse 'FunctionParams' from JSON`,
3202
- );
3203
- }
3204
-
3205
- /** @internal */
3206
- export const CreateEvalResponseBodyFunction$inboundSchema: z.ZodType<
3207
- CreateEvalResponseBodyFunction,
3208
- z.ZodTypeDef,
3209
- unknown
3210
- > = z.object({
3211
- _id: z.string(),
3212
- description: z.string(),
3213
- created: z.string().default("2026-06-26T19:19:38.900Z"),
3214
- updated: z.string().default("2026-06-26T19:19:38.900Z"),
3215
- updated_by_id: z.nullable(z.string()).optional(),
3216
- guardrail_config: z.nullable(
3217
- z.union([
3218
- z.lazy(() =>
3219
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONBoolean$inboundSchema
3220
- ),
3221
- z.lazy(() =>
3222
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONCategorical$inboundSchema
3223
- ),
3224
- z.lazy(() =>
3225
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONNumber$inboundSchema
3226
- ),
3227
- ]),
3228
- ).optional(),
3229
- type: CreateEvalResponseBodyEvalsResponseType$inboundSchema,
3230
- function_params: z.union([
3231
- z.lazy(() => FunctionParams1$inboundSchema),
3232
- z.lazy(() => FunctionParams2$inboundSchema),
3233
- z.lazy(() => CreateEvalFunctionParams3$inboundSchema),
3234
- z.lazy(() => CreateEvalFunctionParams4$inboundSchema),
3235
- z.lazy(() => Five$inboundSchema),
3236
- z.lazy(() => Six$inboundSchema),
3237
- z.lazy(() => Seven$inboundSchema),
3238
- z.lazy(() => Eight$inboundSchema),
3239
- z.lazy(() => Nine$inboundSchema),
3240
- z.lazy(() => Ten$inboundSchema),
3241
- z.lazy(() => Eleven$inboundSchema),
3242
- z.lazy(() => Twelve$inboundSchema),
3243
- z.lazy(() => Thirteen$inboundSchema),
3244
- z.lazy(() => Fourteen$inboundSchema),
3245
- z.lazy(() => Fifteen$inboundSchema),
3246
- z.lazy(() => Sixteen$inboundSchema),
3247
- z.lazy(() => Seventeen$inboundSchema),
3248
- z.lazy(() => Eighteen$inboundSchema),
3249
- z.lazy(() => Nineteen$inboundSchema),
3250
- z.lazy(() => Twenty$inboundSchema),
3251
- z.lazy(() => TwentyOne$inboundSchema),
3252
- z.lazy(() => TwentyTwo$inboundSchema),
3253
- z.lazy(() => TwentyThree$inboundSchema),
3254
- z.lazy(() => TwentyFour$inboundSchema),
3255
- z.lazy(() => TwentyFive$inboundSchema),
3256
- z.lazy(() => TwentySix$inboundSchema),
3257
- z.lazy(() => TwentySeven$inboundSchema),
3258
- z.lazy(() => TwentyEight$inboundSchema),
3259
- z.lazy(() => TwentyNine$inboundSchema),
3260
- z.lazy(() => Thirty$inboundSchema),
3261
- z.lazy(() => ThirtyOne$inboundSchema),
3262
- z.lazy(() => ThirtyTwo$inboundSchema),
3263
- ]),
3264
- key: z.string(),
3265
- }).transform((v) => {
3266
- return remap$(v, {
3267
- "_id": "id",
3268
- "updated_by_id": "updatedById",
3269
- "guardrail_config": "guardrailConfig",
3270
- "function_params": "functionParams",
3271
- });
3272
- });
3273
-
3274
- export function createEvalResponseBodyFunctionFromJSON(
3275
- jsonString: string,
3276
- ): SafeParseResult<CreateEvalResponseBodyFunction, SDKValidationError> {
3277
- return safeParse(
3278
- jsonString,
3279
- (x) => CreateEvalResponseBodyFunction$inboundSchema.parse(JSON.parse(x)),
3280
- `Failed to parse 'CreateEvalResponseBodyFunction' from JSON`,
3281
- );
3282
- }
3283
-
3284
- /** @internal */
3285
- export const CreateEvalGuardrailConfigEvalsResponse200Operator$inboundSchema:
3286
- z.ZodNativeEnum<typeof CreateEvalGuardrailConfigEvalsResponse200Operator> = z
3287
- .nativeEnum(CreateEvalGuardrailConfigEvalsResponse200Operator);
3288
-
3289
- /** @internal */
3290
- export const CreateEvalGuardrailConfigEvalsResponse200Number$inboundSchema:
3291
- z.ZodType<
3292
- CreateEvalGuardrailConfigEvalsResponse200Number,
3293
- z.ZodTypeDef,
3294
- unknown
3295
- > = z.object({
3296
- enabled: z.boolean().default(true),
3297
- alert_on_failure: z.boolean().default(false),
3298
- type: z.literal("number"),
3299
- value: z.number(),
3300
- operator: CreateEvalGuardrailConfigEvalsResponse200Operator$inboundSchema,
3301
- }).transform((v) => {
3302
- return remap$(v, {
3303
- "alert_on_failure": "alertOnFailure",
3304
- });
3305
- });
3306
-
3307
- export function createEvalGuardrailConfigEvalsResponse200NumberFromJSON(
3308
- jsonString: string,
3309
- ): SafeParseResult<
3310
- CreateEvalGuardrailConfigEvalsResponse200Number,
3311
- SDKValidationError
3312
- > {
3313
- return safeParse(
3314
- jsonString,
3315
- (x) =>
3316
- CreateEvalGuardrailConfigEvalsResponse200Number$inboundSchema.parse(
3317
- JSON.parse(x),
3318
- ),
3319
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200Number' from JSON`,
3320
- );
3321
- }
3322
-
3323
- /** @internal */
3324
- export const CreateEvalGuardrailConfigEvalsResponse200Categorical$inboundSchema:
3325
- z.ZodType<
3326
- CreateEvalGuardrailConfigEvalsResponse200Categorical,
3327
- z.ZodTypeDef,
3328
- unknown
3329
- > = z.object({
3330
- enabled: z.boolean().default(true),
3331
- alert_on_failure: z.boolean().default(false),
3332
- type: z.literal("categorical"),
3333
- values: z.array(z.string()),
3334
- }).transform((v) => {
3335
- return remap$(v, {
3336
- "alert_on_failure": "alertOnFailure",
3337
- });
3338
- });
3339
-
3340
- export function createEvalGuardrailConfigEvalsResponse200CategoricalFromJSON(
3341
- jsonString: string,
3342
- ): SafeParseResult<
3343
- CreateEvalGuardrailConfigEvalsResponse200Categorical,
3344
- SDKValidationError
3345
- > {
3346
- return safeParse(
3347
- jsonString,
3348
- (x) =>
3349
- CreateEvalGuardrailConfigEvalsResponse200Categorical$inboundSchema.parse(
3350
- JSON.parse(x),
3351
- ),
3352
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200Categorical' from JSON`,
3353
- );
3354
- }
3355
-
3356
572
  /** @internal */
3357
- export const CreateEvalGuardrailConfigEvalsResponse200Boolean$inboundSchema:
573
+ export const CreateEvalGuardrailConfigEvalsCategorical$outboundSchema:
3358
574
  z.ZodType<
3359
- CreateEvalGuardrailConfigEvalsResponse200Boolean,
575
+ CreateEvalGuardrailConfigEvalsCategorical$Outbound,
3360
576
  z.ZodTypeDef,
3361
- unknown
577
+ CreateEvalGuardrailConfigEvalsCategorical
3362
578
  > = z.object({
3363
579
  enabled: z.boolean().default(true),
3364
- alert_on_failure: z.boolean().default(false),
3365
- type: z.literal("boolean"),
3366
- value: z.boolean(),
580
+ alertOnFailure: z.boolean().default(false),
581
+ type: z.literal("categorical"),
582
+ values: z.array(z.string()),
3367
583
  }).transform((v) => {
3368
584
  return remap$(v, {
3369
- "alert_on_failure": "alertOnFailure",
585
+ alertOnFailure: "alert_on_failure",
3370
586
  });
3371
587
  });
3372
588
 
3373
- export function createEvalGuardrailConfigEvalsResponse200BooleanFromJSON(
3374
- jsonString: string,
3375
- ): SafeParseResult<
3376
- CreateEvalGuardrailConfigEvalsResponse200Boolean,
3377
- SDKValidationError
3378
- > {
3379
- return safeParse(
3380
- jsonString,
3381
- (x) =>
3382
- CreateEvalGuardrailConfigEvalsResponse200Boolean$inboundSchema.parse(
3383
- JSON.parse(x),
3384
- ),
3385
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200Boolean' from JSON`,
3386
- );
3387
- }
3388
-
3389
- /** @internal */
3390
- export const CreateEvalResponseBodyEvalsGuardrailConfig$inboundSchema:
3391
- z.ZodType<CreateEvalResponseBodyEvalsGuardrailConfig, z.ZodTypeDef, unknown> =
3392
- z.union([
3393
- z.lazy(() =>
3394
- CreateEvalGuardrailConfigEvalsResponse200Boolean$inboundSchema
3395
- ),
3396
- z.lazy(() =>
3397
- CreateEvalGuardrailConfigEvalsResponse200Categorical$inboundSchema
3398
- ),
3399
- z.lazy(() =>
3400
- CreateEvalGuardrailConfigEvalsResponse200Number$inboundSchema
3401
- ),
3402
- ]);
3403
-
3404
- export function createEvalResponseBodyEvalsGuardrailConfigFromJSON(
3405
- jsonString: string,
3406
- ): SafeParseResult<
3407
- CreateEvalResponseBodyEvalsGuardrailConfig,
3408
- SDKValidationError
3409
- > {
3410
- return safeParse(
3411
- jsonString,
3412
- (x) =>
3413
- CreateEvalResponseBodyEvalsGuardrailConfig$inboundSchema.parse(
3414
- JSON.parse(x),
3415
- ),
3416
- `Failed to parse 'CreateEvalResponseBodyEvalsGuardrailConfig' from JSON`,
589
+ export function createEvalGuardrailConfigEvalsCategoricalToJSON(
590
+ createEvalGuardrailConfigEvalsCategorical:
591
+ CreateEvalGuardrailConfigEvalsCategorical,
592
+ ): string {
593
+ return JSON.stringify(
594
+ CreateEvalGuardrailConfigEvalsCategorical$outboundSchema.parse(
595
+ createEvalGuardrailConfigEvalsCategorical,
596
+ ),
3417
597
  );
3418
598
  }
3419
599
 
3420
600
  /** @internal */
3421
- export const CreateEvalResponseBodyEvalsType$inboundSchema: z.ZodNativeEnum<
3422
- typeof CreateEvalResponseBodyEvalsType
3423
- > = z.nativeEnum(CreateEvalResponseBodyEvalsType);
601
+ export type CreateEvalGuardrailConfigEvalsBoolean$Outbound = {
602
+ enabled: boolean;
603
+ alert_on_failure: boolean;
604
+ type: "boolean";
605
+ value: boolean;
606
+ };
3424
607
 
3425
608
  /** @internal */
3426
- export const ResponseBodyPython$inboundSchema: z.ZodType<
3427
- ResponseBodyPython,
609
+ export const CreateEvalGuardrailConfigEvalsBoolean$outboundSchema: z.ZodType<
610
+ CreateEvalGuardrailConfigEvalsBoolean$Outbound,
3428
611
  z.ZodTypeDef,
3429
- unknown
612
+ CreateEvalGuardrailConfigEvalsBoolean
3430
613
  > = z.object({
3431
- _id: z.string(),
3432
- description: z.string(),
3433
- created: z.string().default("2026-06-26T19:19:38.900Z"),
3434
- updated: z.string().default("2026-06-26T19:19:38.900Z"),
3435
- updated_by_id: z.nullable(z.string()).optional(),
3436
- guardrail_config: z.nullable(
3437
- z.union([
3438
- z.lazy(() =>
3439
- CreateEvalGuardrailConfigEvalsResponse200Boolean$inboundSchema
3440
- ),
3441
- z.lazy(() =>
3442
- CreateEvalGuardrailConfigEvalsResponse200Categorical$inboundSchema
3443
- ),
3444
- z.lazy(() =>
3445
- CreateEvalGuardrailConfigEvalsResponse200Number$inboundSchema
3446
- ),
3447
- ]),
3448
- ).optional(),
3449
- code: z.string(),
3450
- type: CreateEvalResponseBodyEvalsType$inboundSchema,
3451
- key: z.string(),
614
+ enabled: z.boolean().default(true),
615
+ alertOnFailure: z.boolean().default(false),
616
+ type: z.literal("boolean"),
617
+ value: z.boolean(),
3452
618
  }).transform((v) => {
3453
619
  return remap$(v, {
3454
- "_id": "id",
3455
- "updated_by_id": "updatedById",
3456
- "guardrail_config": "guardrailConfig",
620
+ alertOnFailure: "alert_on_failure",
3457
621
  });
3458
622
  });
3459
623
 
3460
- export function responseBodyPythonFromJSON(
3461
- jsonString: string,
3462
- ): SafeParseResult<ResponseBodyPython, SDKValidationError> {
3463
- return safeParse(
3464
- jsonString,
3465
- (x) => ResponseBodyPython$inboundSchema.parse(JSON.parse(x)),
3466
- `Failed to parse 'ResponseBodyPython' from JSON`,
3467
- );
3468
- }
3469
-
3470
- /** @internal */
3471
- export const CreateEvalGuardrailConfigEvalsResponseOperator$inboundSchema:
3472
- z.ZodNativeEnum<typeof CreateEvalGuardrailConfigEvalsResponseOperator> = z
3473
- .nativeEnum(CreateEvalGuardrailConfigEvalsResponseOperator);
3474
-
3475
- /** @internal */
3476
- export const CreateEvalGuardrailConfigEvalsResponseNumber$inboundSchema:
3477
- z.ZodType<
3478
- CreateEvalGuardrailConfigEvalsResponseNumber,
3479
- z.ZodTypeDef,
3480
- unknown
3481
- > = z.object({
3482
- enabled: z.boolean().default(true),
3483
- alert_on_failure: z.boolean().default(false),
3484
- type: z.literal("number"),
3485
- value: z.number(),
3486
- operator: CreateEvalGuardrailConfigEvalsResponseOperator$inboundSchema,
3487
- }).transform((v) => {
3488
- return remap$(v, {
3489
- "alert_on_failure": "alertOnFailure",
3490
- });
3491
- });
3492
-
3493
- export function createEvalGuardrailConfigEvalsResponseNumberFromJSON(
3494
- jsonString: string,
3495
- ): SafeParseResult<
3496
- CreateEvalGuardrailConfigEvalsResponseNumber,
3497
- SDKValidationError
3498
- > {
3499
- return safeParse(
3500
- jsonString,
3501
- (x) =>
3502
- CreateEvalGuardrailConfigEvalsResponseNumber$inboundSchema.parse(
3503
- JSON.parse(x),
3504
- ),
3505
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponseNumber' from JSON`,
3506
- );
3507
- }
3508
-
3509
- /** @internal */
3510
- export const CreateEvalGuardrailConfigEvalsResponseCategorical$inboundSchema:
3511
- z.ZodType<
3512
- CreateEvalGuardrailConfigEvalsResponseCategorical,
3513
- z.ZodTypeDef,
3514
- unknown
3515
- > = z.object({
3516
- enabled: z.boolean().default(true),
3517
- alert_on_failure: z.boolean().default(false),
3518
- type: z.literal("categorical"),
3519
- values: z.array(z.string()),
3520
- }).transform((v) => {
3521
- return remap$(v, {
3522
- "alert_on_failure": "alertOnFailure",
3523
- });
3524
- });
3525
-
3526
- export function createEvalGuardrailConfigEvalsResponseCategoricalFromJSON(
3527
- jsonString: string,
3528
- ): SafeParseResult<
3529
- CreateEvalGuardrailConfigEvalsResponseCategorical,
3530
- SDKValidationError
3531
- > {
3532
- return safeParse(
3533
- jsonString,
3534
- (x) =>
3535
- CreateEvalGuardrailConfigEvalsResponseCategorical$inboundSchema.parse(
3536
- JSON.parse(x),
3537
- ),
3538
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponseCategorical' from JSON`,
624
+ export function createEvalGuardrailConfigEvalsBooleanToJSON(
625
+ createEvalGuardrailConfigEvalsBoolean: CreateEvalGuardrailConfigEvalsBoolean,
626
+ ): string {
627
+ return JSON.stringify(
628
+ CreateEvalGuardrailConfigEvalsBoolean$outboundSchema.parse(
629
+ createEvalGuardrailConfigEvalsBoolean,
630
+ ),
3539
631
  );
3540
632
  }
3541
633
 
3542
634
  /** @internal */
3543
- export const CreateEvalGuardrailConfigEvalsResponseBoolean$inboundSchema:
3544
- z.ZodType<
3545
- CreateEvalGuardrailConfigEvalsResponseBoolean,
3546
- z.ZodTypeDef,
3547
- unknown
3548
- > = z.object({
3549
- enabled: z.boolean().default(true),
3550
- alert_on_failure: z.boolean().default(false),
3551
- type: z.literal("boolean"),
3552
- value: z.boolean(),
3553
- }).transform((v) => {
3554
- return remap$(v, {
3555
- "alert_on_failure": "alertOnFailure",
3556
- });
3557
- });
3558
-
3559
- export function createEvalGuardrailConfigEvalsResponseBooleanFromJSON(
3560
- jsonString: string,
3561
- ): SafeParseResult<
3562
- CreateEvalGuardrailConfigEvalsResponseBoolean,
3563
- SDKValidationError
3564
- > {
3565
- return safeParse(
3566
- jsonString,
3567
- (x) =>
3568
- CreateEvalGuardrailConfigEvalsResponseBoolean$inboundSchema.parse(
3569
- JSON.parse(x),
3570
- ),
3571
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponseBoolean' from JSON`,
3572
- );
3573
- }
635
+ export type LLMGuardrailConfig$Outbound =
636
+ | CreateEvalGuardrailConfigEvalsBoolean$Outbound
637
+ | CreateEvalGuardrailConfigEvalsCategorical$Outbound
638
+ | CreateEvalGuardrailConfigEvalsNumber$Outbound;
3574
639
 
3575
640
  /** @internal */
3576
- export const CreateEvalResponseBodyGuardrailConfig$inboundSchema: z.ZodType<
3577
- CreateEvalResponseBodyGuardrailConfig,
641
+ export const LLMGuardrailConfig$outboundSchema: z.ZodType<
642
+ LLMGuardrailConfig$Outbound,
3578
643
  z.ZodTypeDef,
3579
- unknown
644
+ LLMGuardrailConfig
3580
645
  > = z.union([
3581
- z.lazy(() => CreateEvalGuardrailConfigEvalsResponseBoolean$inboundSchema),
3582
- z.lazy(() => CreateEvalGuardrailConfigEvalsResponseCategorical$inboundSchema),
3583
- z.lazy(() => CreateEvalGuardrailConfigEvalsResponseNumber$inboundSchema),
646
+ z.lazy(() => CreateEvalGuardrailConfigEvalsBoolean$outboundSchema),
647
+ z.lazy(() => CreateEvalGuardrailConfigEvalsCategorical$outboundSchema),
648
+ z.lazy(() => CreateEvalGuardrailConfigEvalsNumber$outboundSchema),
3584
649
  ]);
3585
650
 
3586
- export function createEvalResponseBodyGuardrailConfigFromJSON(
3587
- jsonString: string,
3588
- ): SafeParseResult<CreateEvalResponseBodyGuardrailConfig, SDKValidationError> {
3589
- return safeParse(
3590
- jsonString,
3591
- (x) =>
3592
- CreateEvalResponseBodyGuardrailConfig$inboundSchema.parse(JSON.parse(x)),
3593
- `Failed to parse 'CreateEvalResponseBodyGuardrailConfig' from JSON`,
651
+ export function llmGuardrailConfigToJSON(
652
+ llmGuardrailConfig: LLMGuardrailConfig,
653
+ ): string {
654
+ return JSON.stringify(
655
+ LLMGuardrailConfig$outboundSchema.parse(llmGuardrailConfig),
3594
656
  );
3595
657
  }
3596
658
 
3597
659
  /** @internal */
3598
- export const CreateEvalResponseBodyType$inboundSchema: z.ZodNativeEnum<
3599
- typeof CreateEvalResponseBodyType
3600
- > = z.nativeEnum(CreateEvalResponseBodyType);
3601
-
3602
- /** @internal */
3603
- export const CreateEvalResponseBodyMethod$inboundSchema: z.ZodNativeEnum<
3604
- typeof CreateEvalResponseBodyMethod
3605
- > = z.nativeEnum(CreateEvalResponseBodyMethod);
660
+ export const LLMOutputType$outboundSchema: z.ZodNativeEnum<
661
+ typeof LLMOutputType
662
+ > = z.nativeEnum(LLMOutputType);
3606
663
 
3607
664
  /** @internal */
3608
- export const CreateEvalResponseBodyHTTP$inboundSchema: z.ZodType<
3609
- CreateEvalResponseBodyHTTP,
3610
- z.ZodTypeDef,
3611
- unknown
3612
- > = z.object({
3613
- _id: z.string(),
3614
- description: z.string(),
3615
- created: z.string().default("2026-06-26T19:19:38.900Z"),
3616
- updated: z.string().default("2026-06-26T19:19:38.900Z"),
3617
- updated_by_id: z.nullable(z.string()).optional(),
3618
- guardrail_config: z.nullable(
3619
- z.union([
3620
- z.lazy(() => CreateEvalGuardrailConfigEvalsResponseBoolean$inboundSchema),
3621
- z.lazy(() =>
3622
- CreateEvalGuardrailConfigEvalsResponseCategorical$inboundSchema
3623
- ),
3624
- z.lazy(() => CreateEvalGuardrailConfigEvalsResponseNumber$inboundSchema),
3625
- ]),
3626
- ).optional(),
3627
- type: CreateEvalResponseBodyType$inboundSchema,
3628
- url: z.string(),
3629
- method: CreateEvalResponseBodyMethod$inboundSchema,
3630
- headers: z.record(z.string()),
3631
- payload: z.record(z.any()),
3632
- key: z.string(),
3633
- }).transform((v) => {
3634
- return remap$(v, {
3635
- "_id": "id",
3636
- "updated_by_id": "updatedById",
3637
- "guardrail_config": "guardrailConfig",
3638
- });
3639
- });
3640
-
3641
- export function createEvalResponseBodyHTTPFromJSON(
3642
- jsonString: string,
3643
- ): SafeParseResult<CreateEvalResponseBodyHTTP, SDKValidationError> {
3644
- return safeParse(
3645
- jsonString,
3646
- (x) => CreateEvalResponseBodyHTTP$inboundSchema.parse(JSON.parse(x)),
3647
- `Failed to parse 'CreateEvalResponseBodyHTTP' from JSON`,
3648
- );
3649
- }
665
+ export const LLMType$outboundSchema: z.ZodNativeEnum<typeof LLMType> = z
666
+ .nativeEnum(LLMType);
3650
667
 
3651
668
  /** @internal */
3652
- export const CreateEvalGuardrailConfigEvalsOperator$inboundSchema:
3653
- z.ZodNativeEnum<typeof CreateEvalGuardrailConfigEvalsOperator> = z.nativeEnum(
3654
- CreateEvalGuardrailConfigEvalsOperator,
3655
- );
669
+ export type LLMCategoricalLabels$Outbound = {
670
+ value: string;
671
+ description?: string | undefined;
672
+ };
3656
673
 
3657
674
  /** @internal */
3658
- export const CreateEvalGuardrailConfigEvalsNumber$inboundSchema: z.ZodType<
3659
- CreateEvalGuardrailConfigEvalsNumber,
675
+ export const LLMCategoricalLabels$outboundSchema: z.ZodType<
676
+ LLMCategoricalLabels$Outbound,
3660
677
  z.ZodTypeDef,
3661
- unknown
678
+ LLMCategoricalLabels
3662
679
  > = z.object({
3663
- enabled: z.boolean().default(true),
3664
- alert_on_failure: z.boolean().default(false),
3665
- type: z.literal("number"),
3666
- value: z.number(),
3667
- operator: CreateEvalGuardrailConfigEvalsOperator$inboundSchema,
3668
- }).transform((v) => {
3669
- return remap$(v, {
3670
- "alert_on_failure": "alertOnFailure",
3671
- });
680
+ value: z.string(),
681
+ description: z.string().optional(),
3672
682
  });
3673
683
 
3674
- export function createEvalGuardrailConfigEvalsNumberFromJSON(
3675
- jsonString: string,
3676
- ): SafeParseResult<CreateEvalGuardrailConfigEvalsNumber, SDKValidationError> {
3677
- return safeParse(
3678
- jsonString,
3679
- (x) =>
3680
- CreateEvalGuardrailConfigEvalsNumber$inboundSchema.parse(JSON.parse(x)),
3681
- `Failed to parse 'CreateEvalGuardrailConfigEvalsNumber' from JSON`,
684
+ export function llmCategoricalLabelsToJSON(
685
+ llmCategoricalLabels: LLMCategoricalLabels,
686
+ ): string {
687
+ return JSON.stringify(
688
+ LLMCategoricalLabels$outboundSchema.parse(llmCategoricalLabels),
3682
689
  );
3683
690
  }
3684
691
 
3685
692
  /** @internal */
3686
- export const CreateEvalGuardrailConfigEvalsCategorical$inboundSchema: z.ZodType<
3687
- CreateEvalGuardrailConfigEvalsCategorical,
3688
- z.ZodTypeDef,
3689
- unknown
3690
- > = z.object({
3691
- enabled: z.boolean().default(true),
3692
- alert_on_failure: z.boolean().default(false),
3693
- type: z.literal("categorical"),
3694
- values: z.array(z.string()),
3695
- }).transform((v) => {
3696
- return remap$(v, {
3697
- "alert_on_failure": "alertOnFailure",
3698
- });
3699
- });
3700
-
3701
- export function createEvalGuardrailConfigEvalsCategoricalFromJSON(
3702
- jsonString: string,
3703
- ): SafeParseResult<
3704
- CreateEvalGuardrailConfigEvalsCategorical,
3705
- SDKValidationError
3706
- > {
3707
- return safeParse(
3708
- jsonString,
3709
- (x) =>
3710
- CreateEvalGuardrailConfigEvalsCategorical$inboundSchema.parse(
3711
- JSON.parse(x),
3712
- ),
3713
- `Failed to parse 'CreateEvalGuardrailConfigEvalsCategorical' from JSON`,
3714
- );
3715
- }
693
+ export type CreateEvalLLMRetry$Outbound = {
694
+ count: number;
695
+ on_codes?: Array<number> | undefined;
696
+ };
3716
697
 
3717
698
  /** @internal */
3718
- export const CreateEvalGuardrailConfigEvalsBoolean$inboundSchema: z.ZodType<
3719
- CreateEvalGuardrailConfigEvalsBoolean,
699
+ export const CreateEvalLLMRetry$outboundSchema: z.ZodType<
700
+ CreateEvalLLMRetry$Outbound,
3720
701
  z.ZodTypeDef,
3721
- unknown
702
+ CreateEvalLLMRetry
3722
703
  > = z.object({
3723
- enabled: z.boolean().default(true),
3724
- alert_on_failure: z.boolean().default(false),
3725
- type: z.literal("boolean"),
3726
- value: z.boolean(),
704
+ count: z.number().int().default(2),
705
+ onCodes: z.array(z.number().int()).optional(),
3727
706
  }).transform((v) => {
3728
707
  return remap$(v, {
3729
- "alert_on_failure": "alertOnFailure",
3730
- });
3731
- });
3732
-
3733
- export function createEvalGuardrailConfigEvalsBooleanFromJSON(
3734
- jsonString: string,
3735
- ): SafeParseResult<CreateEvalGuardrailConfigEvalsBoolean, SDKValidationError> {
3736
- return safeParse(
3737
- jsonString,
3738
- (x) =>
3739
- CreateEvalGuardrailConfigEvalsBoolean$inboundSchema.parse(JSON.parse(x)),
3740
- `Failed to parse 'CreateEvalGuardrailConfigEvalsBoolean' from JSON`,
3741
- );
3742
- }
3743
-
3744
- /** @internal */
3745
- export const ResponseBodyGuardrailConfig$inboundSchema: z.ZodType<
3746
- ResponseBodyGuardrailConfig,
3747
- z.ZodTypeDef,
3748
- unknown
3749
- > = z.union([
3750
- z.lazy(() => CreateEvalGuardrailConfigEvalsBoolean$inboundSchema),
3751
- z.lazy(() => CreateEvalGuardrailConfigEvalsCategorical$inboundSchema),
3752
- z.lazy(() => CreateEvalGuardrailConfigEvalsNumber$inboundSchema),
3753
- ]);
3754
-
3755
- export function responseBodyGuardrailConfigFromJSON(
3756
- jsonString: string,
3757
- ): SafeParseResult<ResponseBodyGuardrailConfig, SDKValidationError> {
3758
- return safeParse(
3759
- jsonString,
3760
- (x) => ResponseBodyGuardrailConfig$inboundSchema.parse(JSON.parse(x)),
3761
- `Failed to parse 'ResponseBodyGuardrailConfig' from JSON`,
3762
- );
3763
- }
3764
-
3765
- /** @internal */
3766
- export const ResponseBodyType$inboundSchema: z.ZodNativeEnum<
3767
- typeof ResponseBodyType
3768
- > = z.nativeEnum(ResponseBodyType);
3769
-
3770
- /** @internal */
3771
- export const Json$inboundSchema: z.ZodType<Json, z.ZodTypeDef, unknown> = z
3772
- .object({
3773
- _id: z.string(),
3774
- description: z.string(),
3775
- created: z.string().default("2026-06-26T19:19:38.900Z"),
3776
- updated: z.string().default("2026-06-26T19:19:38.900Z"),
3777
- updated_by_id: z.nullable(z.string()).optional(),
3778
- guardrail_config: z.nullable(
3779
- z.union([
3780
- z.lazy(() => CreateEvalGuardrailConfigEvalsBoolean$inboundSchema),
3781
- z.lazy(() => CreateEvalGuardrailConfigEvalsCategorical$inboundSchema),
3782
- z.lazy(() => CreateEvalGuardrailConfigEvalsNumber$inboundSchema),
3783
- ]),
3784
- ).optional(),
3785
- type: ResponseBodyType$inboundSchema,
3786
- schema: z.string(),
3787
- key: z.string(),
3788
- }).transform((v) => {
3789
- return remap$(v, {
3790
- "_id": "id",
3791
- "updated_by_id": "updatedById",
3792
- "guardrail_config": "guardrailConfig",
3793
- });
3794
- });
3795
-
3796
- export function jsonFromJSON(
3797
- jsonString: string,
3798
- ): SafeParseResult<Json, SDKValidationError> {
3799
- return safeParse(
3800
- jsonString,
3801
- (x) => Json$inboundSchema.parse(JSON.parse(x)),
3802
- `Failed to parse 'Json' from JSON`,
3803
- );
3804
- }
3805
-
3806
- /** @internal */
3807
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Operator$inboundSchema:
3808
- z.ZodNativeEnum<
3809
- typeof CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Operator
3810
- > = z.nativeEnum(
3811
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Operator,
3812
- );
3813
-
3814
- /** @internal */
3815
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Number$inboundSchema:
3816
- z.ZodType<
3817
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Number,
3818
- z.ZodTypeDef,
3819
- unknown
3820
- > = z.object({
3821
- enabled: z.boolean().default(true),
3822
- alert_on_failure: z.boolean().default(false),
3823
- type: z.literal("number"),
3824
- value: z.number(),
3825
- operator:
3826
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Operator$inboundSchema,
3827
- }).transform((v) => {
3828
- return remap$(v, {
3829
- "alert_on_failure": "alertOnFailure",
3830
- });
3831
- });
3832
-
3833
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1NumberFromJSON(
3834
- jsonString: string,
3835
- ): SafeParseResult<
3836
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Number,
3837
- SDKValidationError
3838
- > {
3839
- return safeParse(
3840
- jsonString,
3841
- (x) =>
3842
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Number$inboundSchema
3843
- .parse(JSON.parse(x)),
3844
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Number' from JSON`,
3845
- );
3846
- }
3847
-
3848
- /** @internal */
3849
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Categorical$inboundSchema:
3850
- z.ZodType<
3851
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Categorical,
3852
- z.ZodTypeDef,
3853
- unknown
3854
- > = z.object({
3855
- enabled: z.boolean().default(true),
3856
- alert_on_failure: z.boolean().default(false),
3857
- type: z.literal("categorical"),
3858
- values: z.array(z.string()),
3859
- }).transform((v) => {
3860
- return remap$(v, {
3861
- "alert_on_failure": "alertOnFailure",
3862
- });
708
+ onCodes: "on_codes",
3863
709
  });
710
+ });
3864
711
 
3865
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1CategoricalFromJSON(
3866
- jsonString: string,
3867
- ): SafeParseResult<
3868
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Categorical,
3869
- SDKValidationError
3870
- > {
3871
- return safeParse(
3872
- jsonString,
3873
- (x) =>
3874
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Categorical$inboundSchema
3875
- .parse(JSON.parse(x)),
3876
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Categorical' from JSON`,
712
+ export function createEvalLLMRetryToJSON(
713
+ createEvalLLMRetry: CreateEvalLLMRetry,
714
+ ): string {
715
+ return JSON.stringify(
716
+ CreateEvalLLMRetry$outboundSchema.parse(createEvalLLMRetry),
3877
717
  );
3878
718
  }
3879
719
 
3880
720
  /** @internal */
3881
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Boolean$inboundSchema:
3882
- z.ZodType<
3883
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Boolean,
3884
- z.ZodTypeDef,
3885
- unknown
3886
- > = z.object({
3887
- enabled: z.boolean().default(true),
3888
- alert_on_failure: z.boolean().default(false),
3889
- type: z.literal("boolean"),
3890
- value: z.boolean(),
3891
- }).transform((v) => {
3892
- return remap$(v, {
3893
- "alert_on_failure": "alertOnFailure",
3894
- });
3895
- });
3896
-
3897
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1BooleanFromJSON(
3898
- jsonString: string,
3899
- ): SafeParseResult<
3900
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Boolean,
3901
- SDKValidationError
3902
- > {
3903
- return safeParse(
3904
- jsonString,
3905
- (x) =>
3906
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Boolean$inboundSchema
3907
- .parse(JSON.parse(x)),
3908
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Boolean' from JSON`,
3909
- );
3910
- }
721
+ export type CreateEvalLLMFallbacks$Outbound = {
722
+ model: string;
723
+ };
3911
724
 
3912
725
  /** @internal */
3913
- export const CreateEvalLLMEvalsResponseGuardrailConfig$inboundSchema: z.ZodType<
3914
- CreateEvalLLMEvalsResponseGuardrailConfig,
726
+ export const CreateEvalLLMFallbacks$outboundSchema: z.ZodType<
727
+ CreateEvalLLMFallbacks$Outbound,
3915
728
  z.ZodTypeDef,
3916
- unknown
3917
- > = z.union([
3918
- z.lazy(() =>
3919
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Boolean$inboundSchema
3920
- ),
3921
- z.lazy(() =>
3922
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Categorical$inboundSchema
3923
- ),
3924
- z.lazy(() =>
3925
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Number$inboundSchema
3926
- ),
3927
- ]);
729
+ CreateEvalLLMFallbacks
730
+ > = z.object({
731
+ model: z.string(),
732
+ });
3928
733
 
3929
- export function createEvalLLMEvalsResponseGuardrailConfigFromJSON(
3930
- jsonString: string,
3931
- ): SafeParseResult<
3932
- CreateEvalLLMEvalsResponseGuardrailConfig,
3933
- SDKValidationError
3934
- > {
3935
- return safeParse(
3936
- jsonString,
3937
- (x) =>
3938
- CreateEvalLLMEvalsResponseGuardrailConfig$inboundSchema.parse(
3939
- JSON.parse(x),
3940
- ),
3941
- `Failed to parse 'CreateEvalLLMEvalsResponseGuardrailConfig' from JSON`,
734
+ export function createEvalLLMFallbacksToJSON(
735
+ createEvalLLMFallbacks: CreateEvalLLMFallbacks,
736
+ ): string {
737
+ return JSON.stringify(
738
+ CreateEvalLLMFallbacks$outboundSchema.parse(createEvalLLMFallbacks),
3942
739
  );
3943
740
  }
3944
741
 
3945
742
  /** @internal */
3946
- export const CreateEvalLLMEvalsResponseType$inboundSchema: z.ZodNativeEnum<
3947
- typeof CreateEvalLLMEvalsResponseType
3948
- > = z.nativeEnum(CreateEvalLLMEvalsResponseType);
743
+ export type LLMJudges$Outbound = {
744
+ model: string;
745
+ retry?: CreateEvalLLMRetry$Outbound | undefined;
746
+ fallbacks?: Array<CreateEvalLLMFallbacks$Outbound> | undefined;
747
+ };
3949
748
 
3950
749
  /** @internal */
3951
- export const CreateEvalLLMEvalsCategoricalLabels$inboundSchema: z.ZodType<
3952
- CreateEvalLLMEvalsCategoricalLabels,
750
+ export const LLMJudges$outboundSchema: z.ZodType<
751
+ LLMJudges$Outbound,
3953
752
  z.ZodTypeDef,
3954
- unknown
753
+ LLMJudges
3955
754
  > = z.object({
3956
- value: z.string(),
3957
- description: z.string().optional(),
755
+ model: z.string(),
756
+ retry: z.lazy(() => CreateEvalLLMRetry$outboundSchema).optional(),
757
+ fallbacks: z.array(z.lazy(() => CreateEvalLLMFallbacks$outboundSchema))
758
+ .optional(),
3958
759
  });
3959
760
 
3960
- export function createEvalLLMEvalsCategoricalLabelsFromJSON(
3961
- jsonString: string,
3962
- ): SafeParseResult<CreateEvalLLMEvalsCategoricalLabels, SDKValidationError> {
3963
- return safeParse(
3964
- jsonString,
3965
- (x) =>
3966
- CreateEvalLLMEvalsCategoricalLabels$inboundSchema.parse(JSON.parse(x)),
3967
- `Failed to parse 'CreateEvalLLMEvalsCategoricalLabels' from JSON`,
3968
- );
761
+ export function llmJudgesToJSON(llmJudges: LLMJudges): string {
762
+ return JSON.stringify(LLMJudges$outboundSchema.parse(llmJudges));
3969
763
  }
3970
764
 
3971
765
  /** @internal */
3972
- export const CreateEvalLLMEvalsResponseRetry$inboundSchema: z.ZodType<
3973
- CreateEvalLLMEvalsResponseRetry,
766
+ export type LLMRetry$Outbound = {
767
+ count: number;
768
+ on_codes?: Array<number> | undefined;
769
+ };
770
+
771
+ /** @internal */
772
+ export const LLMRetry$outboundSchema: z.ZodType<
773
+ LLMRetry$Outbound,
3974
774
  z.ZodTypeDef,
3975
- unknown
775
+ LLMRetry
3976
776
  > = z.object({
3977
777
  count: z.number().int().default(2),
3978
- on_codes: z.array(z.number().int()).optional(),
778
+ onCodes: z.array(z.number().int()).optional(),
3979
779
  }).transform((v) => {
3980
780
  return remap$(v, {
3981
- "on_codes": "onCodes",
781
+ onCodes: "on_codes",
3982
782
  });
3983
783
  });
3984
784
 
3985
- export function createEvalLLMEvalsResponseRetryFromJSON(
3986
- jsonString: string,
3987
- ): SafeParseResult<CreateEvalLLMEvalsResponseRetry, SDKValidationError> {
3988
- return safeParse(
3989
- jsonString,
3990
- (x) => CreateEvalLLMEvalsResponseRetry$inboundSchema.parse(JSON.parse(x)),
3991
- `Failed to parse 'CreateEvalLLMEvalsResponseRetry' from JSON`,
3992
- );
785
+ export function llmRetryToJSON(llmRetry: LLMRetry): string {
786
+ return JSON.stringify(LLMRetry$outboundSchema.parse(llmRetry));
3993
787
  }
3994
788
 
3995
789
  /** @internal */
3996
- export const CreateEvalLLMEvalsResponseFallbacks$inboundSchema: z.ZodType<
3997
- CreateEvalLLMEvalsResponseFallbacks,
790
+ export type LLMFallbacks$Outbound = {
791
+ model: string;
792
+ };
793
+
794
+ /** @internal */
795
+ export const LLMFallbacks$outboundSchema: z.ZodType<
796
+ LLMFallbacks$Outbound,
3998
797
  z.ZodTypeDef,
3999
- unknown
798
+ LLMFallbacks
4000
799
  > = z.object({
4001
800
  model: z.string(),
4002
801
  });
4003
802
 
4004
- export function createEvalLLMEvalsResponseFallbacksFromJSON(
4005
- jsonString: string,
4006
- ): SafeParseResult<CreateEvalLLMEvalsResponseFallbacks, SDKValidationError> {
4007
- return safeParse(
4008
- jsonString,
4009
- (x) =>
4010
- CreateEvalLLMEvalsResponseFallbacks$inboundSchema.parse(JSON.parse(x)),
4011
- `Failed to parse 'CreateEvalLLMEvalsResponseFallbacks' from JSON`,
4012
- );
803
+ export function llmFallbacksToJSON(llmFallbacks: LLMFallbacks): string {
804
+ return JSON.stringify(LLMFallbacks$outboundSchema.parse(llmFallbacks));
4013
805
  }
4014
806
 
4015
807
  /** @internal */
4016
- export const CreateEvalLLMJudges$inboundSchema: z.ZodType<
4017
- CreateEvalLLMJudges,
808
+ export type LLMReplacementJudges$Outbound = {
809
+ model: string;
810
+ retry?: LLMRetry$Outbound | undefined;
811
+ fallbacks?: Array<LLMFallbacks$Outbound> | undefined;
812
+ };
813
+
814
+ /** @internal */
815
+ export const LLMReplacementJudges$outboundSchema: z.ZodType<
816
+ LLMReplacementJudges$Outbound,
4018
817
  z.ZodTypeDef,
4019
- unknown
818
+ LLMReplacementJudges
4020
819
  > = z.object({
4021
820
  model: z.string(),
4022
- retry: z.lazy(() => CreateEvalLLMEvalsResponseRetry$inboundSchema).optional(),
4023
- fallbacks: z.array(
4024
- z.lazy(() => CreateEvalLLMEvalsResponseFallbacks$inboundSchema),
4025
- ).optional(),
821
+ retry: z.lazy(() => LLMRetry$outboundSchema).optional(),
822
+ fallbacks: z.array(z.lazy(() => LLMFallbacks$outboundSchema)).optional(),
4026
823
  });
4027
824
 
4028
- export function createEvalLLMJudgesFromJSON(
4029
- jsonString: string,
4030
- ): SafeParseResult<CreateEvalLLMJudges, SDKValidationError> {
4031
- return safeParse(
4032
- jsonString,
4033
- (x) => CreateEvalLLMJudges$inboundSchema.parse(JSON.parse(x)),
4034
- `Failed to parse 'CreateEvalLLMJudges' from JSON`,
825
+ export function llmReplacementJudgesToJSON(
826
+ llmReplacementJudges: LLMReplacementJudges,
827
+ ): string {
828
+ return JSON.stringify(
829
+ LLMReplacementJudges$outboundSchema.parse(llmReplacementJudges),
4035
830
  );
4036
831
  }
4037
832
 
4038
833
  /** @internal */
4039
- export const CreateEvalLLMEvalsRetry$inboundSchema: z.ZodType<
4040
- CreateEvalLLMEvalsRetry,
834
+ export const LLMTieValue$outboundSchema: z.ZodNativeEnum<typeof LLMTieValue> = z
835
+ .nativeEnum(LLMTieValue);
836
+
837
+ /** @internal */
838
+ export type LLMJury$Outbound = {
839
+ judges: Array<LLMJudges$Outbound>;
840
+ replacement_judges?: Array<LLMReplacementJudges$Outbound> | undefined;
841
+ min_successful_judges: number;
842
+ tie_value: string;
843
+ };
844
+
845
+ /** @internal */
846
+ export const LLMJury$outboundSchema: z.ZodType<
847
+ LLMJury$Outbound,
4041
848
  z.ZodTypeDef,
4042
- unknown
849
+ LLMJury
4043
850
  > = z.object({
4044
- count: z.number().int().default(2),
4045
- on_codes: z.array(z.number().int()).optional(),
851
+ judges: z.array(z.lazy(() => LLMJudges$outboundSchema)),
852
+ replacementJudges: z.array(z.lazy(() => LLMReplacementJudges$outboundSchema))
853
+ .optional(),
854
+ minSuccessfulJudges: z.number().int().default(2),
855
+ tieValue: LLMTieValue$outboundSchema.default("Tie"),
4046
856
  }).transform((v) => {
4047
857
  return remap$(v, {
4048
- "on_codes": "onCodes",
858
+ replacementJudges: "replacement_judges",
859
+ minSuccessfulJudges: "min_successful_judges",
860
+ tieValue: "tie_value",
4049
861
  });
4050
862
  });
4051
863
 
4052
- export function createEvalLLMEvalsRetryFromJSON(
4053
- jsonString: string,
4054
- ): SafeParseResult<CreateEvalLLMEvalsRetry, SDKValidationError> {
4055
- return safeParse(
4056
- jsonString,
4057
- (x) => CreateEvalLLMEvalsRetry$inboundSchema.parse(JSON.parse(x)),
4058
- `Failed to parse 'CreateEvalLLMEvalsRetry' from JSON`,
4059
- );
864
+ export function llmJuryToJSON(llmJury: LLMJury): string {
865
+ return JSON.stringify(LLMJury$outboundSchema.parse(llmJury));
4060
866
  }
4061
867
 
4062
868
  /** @internal */
4063
- export const CreateEvalLLMEvalsFallbacks$inboundSchema: z.ZodType<
4064
- CreateEvalLLMEvalsFallbacks,
4065
- z.ZodTypeDef,
4066
- unknown
4067
- > = z.object({
4068
- model: z.string(),
4069
- });
869
+ export type Llm2$Outbound = {
870
+ guardrail_config?:
871
+ | CreateEvalGuardrailConfigEvalsBoolean$Outbound
872
+ | CreateEvalGuardrailConfigEvalsCategorical$Outbound
873
+ | CreateEvalGuardrailConfigEvalsNumber$Outbound
874
+ | null
875
+ | undefined;
876
+ output_type?: string | undefined;
877
+ type: string;
878
+ repetitions?: number | null | undefined;
879
+ prompt: string;
880
+ categories?: Array<string> | null | undefined;
881
+ categorical_labels?: Array<LLMCategoricalLabels$Outbound> | null | undefined;
882
+ dataset_id?: string | undefined;
883
+ path: string;
884
+ description: string;
885
+ key: string;
886
+ mode: "jury";
887
+ jury: LLMJury$Outbound;
888
+ };
4070
889
 
4071
- export function createEvalLLMEvalsFallbacksFromJSON(
4072
- jsonString: string,
4073
- ): SafeParseResult<CreateEvalLLMEvalsFallbacks, SDKValidationError> {
4074
- return safeParse(
4075
- jsonString,
4076
- (x) => CreateEvalLLMEvalsFallbacks$inboundSchema.parse(JSON.parse(x)),
4077
- `Failed to parse 'CreateEvalLLMEvalsFallbacks' from JSON`,
4078
- );
890
+ /** @internal */
891
+ export const Llm2$outboundSchema: z.ZodType<Llm2$Outbound, z.ZodTypeDef, Llm2> =
892
+ z.object({
893
+ guardrailConfig: z.nullable(
894
+ z.union([
895
+ z.lazy(() => CreateEvalGuardrailConfigEvalsBoolean$outboundSchema),
896
+ z.lazy(() => CreateEvalGuardrailConfigEvalsCategorical$outboundSchema),
897
+ z.lazy(() => CreateEvalGuardrailConfigEvalsNumber$outboundSchema),
898
+ ]),
899
+ ).optional(),
900
+ outputType: LLMOutputType$outboundSchema.optional(),
901
+ type: LLMType$outboundSchema,
902
+ repetitions: z.nullable(z.number().int()).optional(),
903
+ prompt: z.string(),
904
+ categories: z.nullable(z.array(z.string())).optional(),
905
+ categoricalLabels: z.nullable(
906
+ z.array(z.lazy(() => LLMCategoricalLabels$outboundSchema)),
907
+ ).optional(),
908
+ datasetId: z.string().optional(),
909
+ path: z.string(),
910
+ description: z.string().default(""),
911
+ key: z.string(),
912
+ mode: z.literal("jury"),
913
+ jury: z.lazy(() => LLMJury$outboundSchema),
914
+ }).transform((v) => {
915
+ return remap$(v, {
916
+ guardrailConfig: "guardrail_config",
917
+ outputType: "output_type",
918
+ categoricalLabels: "categorical_labels",
919
+ datasetId: "dataset_id",
920
+ });
921
+ });
922
+
923
+ export function llm2ToJSON(llm2: Llm2): string {
924
+ return JSON.stringify(Llm2$outboundSchema.parse(llm2));
4079
925
  }
4080
926
 
4081
927
  /** @internal */
4082
- export const CreateEvalLLMReplacementJudges$inboundSchema: z.ZodType<
4083
- CreateEvalLLMReplacementJudges,
928
+ export const CreateEvalGuardrailConfigOperator$outboundSchema: z.ZodNativeEnum<
929
+ typeof CreateEvalGuardrailConfigOperator
930
+ > = z.nativeEnum(CreateEvalGuardrailConfigOperator);
931
+
932
+ /** @internal */
933
+ export type CreateEvalGuardrailConfigNumber$Outbound = {
934
+ enabled: boolean;
935
+ alert_on_failure: boolean;
936
+ type: "number";
937
+ value: number;
938
+ operator: string;
939
+ };
940
+
941
+ /** @internal */
942
+ export const CreateEvalGuardrailConfigNumber$outboundSchema: z.ZodType<
943
+ CreateEvalGuardrailConfigNumber$Outbound,
4084
944
  z.ZodTypeDef,
4085
- unknown
945
+ CreateEvalGuardrailConfigNumber
4086
946
  > = z.object({
4087
- model: z.string(),
4088
- retry: z.lazy(() => CreateEvalLLMEvalsRetry$inboundSchema).optional(),
4089
- fallbacks: z.array(z.lazy(() => CreateEvalLLMEvalsFallbacks$inboundSchema))
4090
- .optional(),
947
+ enabled: z.boolean().default(true),
948
+ alertOnFailure: z.boolean().default(false),
949
+ type: z.literal("number"),
950
+ value: z.number(),
951
+ operator: CreateEvalGuardrailConfigOperator$outboundSchema,
952
+ }).transform((v) => {
953
+ return remap$(v, {
954
+ alertOnFailure: "alert_on_failure",
955
+ });
4091
956
  });
4092
957
 
4093
- export function createEvalLLMReplacementJudgesFromJSON(
4094
- jsonString: string,
4095
- ): SafeParseResult<CreateEvalLLMReplacementJudges, SDKValidationError> {
4096
- return safeParse(
4097
- jsonString,
4098
- (x) => CreateEvalLLMReplacementJudges$inboundSchema.parse(JSON.parse(x)),
4099
- `Failed to parse 'CreateEvalLLMReplacementJudges' from JSON`,
958
+ export function createEvalGuardrailConfigNumberToJSON(
959
+ createEvalGuardrailConfigNumber: CreateEvalGuardrailConfigNumber,
960
+ ): string {
961
+ return JSON.stringify(
962
+ CreateEvalGuardrailConfigNumber$outboundSchema.parse(
963
+ createEvalGuardrailConfigNumber,
964
+ ),
4100
965
  );
4101
966
  }
4102
967
 
4103
968
  /** @internal */
4104
- export const CreateEvalLLMTieValue$inboundSchema: z.ZodNativeEnum<
4105
- typeof CreateEvalLLMTieValue
4106
- > = z.nativeEnum(CreateEvalLLMTieValue);
969
+ export type CreateEvalGuardrailConfigCategorical$Outbound = {
970
+ enabled: boolean;
971
+ alert_on_failure: boolean;
972
+ type: "categorical";
973
+ values: Array<string>;
974
+ };
4107
975
 
4108
976
  /** @internal */
4109
- export const CreateEvalLLMJury$inboundSchema: z.ZodType<
4110
- CreateEvalLLMJury,
977
+ export const CreateEvalGuardrailConfigCategorical$outboundSchema: z.ZodType<
978
+ CreateEvalGuardrailConfigCategorical$Outbound,
4111
979
  z.ZodTypeDef,
4112
- unknown
980
+ CreateEvalGuardrailConfigCategorical
4113
981
  > = z.object({
4114
- judges: z.array(z.lazy(() => CreateEvalLLMJudges$inboundSchema)),
4115
- replacement_judges: z.array(
4116
- z.lazy(() => CreateEvalLLMReplacementJudges$inboundSchema),
4117
- ).optional(),
4118
- min_successful_judges: z.number().int().default(2),
4119
- tie_value: CreateEvalLLMTieValue$inboundSchema.default("Tie"),
982
+ enabled: z.boolean().default(true),
983
+ alertOnFailure: z.boolean().default(false),
984
+ type: z.literal("categorical"),
985
+ values: z.array(z.string()),
4120
986
  }).transform((v) => {
4121
987
  return remap$(v, {
4122
- "replacement_judges": "replacementJudges",
4123
- "min_successful_judges": "minSuccessfulJudges",
4124
- "tie_value": "tieValue",
988
+ alertOnFailure: "alert_on_failure",
4125
989
  });
4126
990
  });
4127
991
 
4128
- export function createEvalLLMJuryFromJSON(
4129
- jsonString: string,
4130
- ): SafeParseResult<CreateEvalLLMJury, SDKValidationError> {
4131
- return safeParse(
4132
- jsonString,
4133
- (x) => CreateEvalLLMJury$inboundSchema.parse(JSON.parse(x)),
4134
- `Failed to parse 'CreateEvalLLMJury' from JSON`,
992
+ export function createEvalGuardrailConfigCategoricalToJSON(
993
+ createEvalGuardrailConfigCategorical: CreateEvalGuardrailConfigCategorical,
994
+ ): string {
995
+ return JSON.stringify(
996
+ CreateEvalGuardrailConfigCategorical$outboundSchema.parse(
997
+ createEvalGuardrailConfigCategorical,
998
+ ),
4135
999
  );
4136
1000
  }
4137
1001
 
4138
1002
  /** @internal */
4139
- export const CreateEvalLlm2$inboundSchema: z.ZodType<
4140
- CreateEvalLlm2,
1003
+ export type CreateEvalGuardrailConfigBoolean$Outbound = {
1004
+ enabled: boolean;
1005
+ alert_on_failure: boolean;
1006
+ type: "boolean";
1007
+ value: boolean;
1008
+ };
1009
+
1010
+ /** @internal */
1011
+ export const CreateEvalGuardrailConfigBoolean$outboundSchema: z.ZodType<
1012
+ CreateEvalGuardrailConfigBoolean$Outbound,
4141
1013
  z.ZodTypeDef,
4142
- unknown
1014
+ CreateEvalGuardrailConfigBoolean
4143
1015
  > = z.object({
4144
- _id: z.string(),
4145
- description: z.string(),
4146
- created: z.string().default("2026-06-26T19:19:38.900Z"),
4147
- updated: z.string().default("2026-06-26T19:19:38.900Z"),
4148
- updated_by_id: z.nullable(z.string()).optional(),
4149
- guardrail_config: z.nullable(
4150
- z.union([
4151
- z.lazy(() =>
4152
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Boolean$inboundSchema
4153
- ),
4154
- z.lazy(() =>
4155
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Categorical$inboundSchema
4156
- ),
4157
- z.lazy(() =>
4158
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1Number$inboundSchema
4159
- ),
4160
- ]),
4161
- ).optional(),
4162
- type: CreateEvalLLMEvalsResponseType$inboundSchema,
4163
- repetitions: z.nullable(z.number().int()).optional(),
4164
- prompt: z.string(),
4165
- categories: z.nullable(z.array(z.string())).optional(),
4166
- categorical_labels: z.nullable(
4167
- z.array(z.lazy(() => CreateEvalLLMEvalsCategoricalLabels$inboundSchema)),
4168
- ).optional(),
4169
- dataset_id: z.string().optional(),
4170
- key: z.string(),
4171
- mode: z.literal("jury"),
4172
- jury: z.lazy(() => CreateEvalLLMJury$inboundSchema),
1016
+ enabled: z.boolean().default(true),
1017
+ alertOnFailure: z.boolean().default(false),
1018
+ type: z.literal("boolean"),
1019
+ value: z.boolean(),
4173
1020
  }).transform((v) => {
4174
1021
  return remap$(v, {
4175
- "_id": "id",
4176
- "updated_by_id": "updatedById",
4177
- "guardrail_config": "guardrailConfig",
4178
- "categorical_labels": "categoricalLabels",
4179
- "dataset_id": "datasetId",
1022
+ alertOnFailure: "alert_on_failure",
4180
1023
  });
4181
1024
  });
4182
1025
 
4183
- export function createEvalLLM2FromJSON(
4184
- jsonString: string,
4185
- ): SafeParseResult<CreateEvalLlm2, SDKValidationError> {
4186
- return safeParse(
4187
- jsonString,
4188
- (x) => CreateEvalLlm2$inboundSchema.parse(JSON.parse(x)),
4189
- `Failed to parse 'CreateEvalLlm2' from JSON`,
1026
+ export function createEvalGuardrailConfigBooleanToJSON(
1027
+ createEvalGuardrailConfigBoolean: CreateEvalGuardrailConfigBoolean,
1028
+ ): string {
1029
+ return JSON.stringify(
1030
+ CreateEvalGuardrailConfigBoolean$outboundSchema.parse(
1031
+ createEvalGuardrailConfigBoolean,
1032
+ ),
4190
1033
  );
4191
1034
  }
4192
1035
 
4193
1036
  /** @internal */
4194
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMOperator$inboundSchema:
4195
- z.ZodNativeEnum<
4196
- typeof CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMOperator
4197
- > = z.nativeEnum(
4198
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMOperator,
4199
- );
1037
+ export type CreateEvalLLMGuardrailConfig$Outbound =
1038
+ | CreateEvalGuardrailConfigBoolean$Outbound
1039
+ | CreateEvalGuardrailConfigCategorical$Outbound
1040
+ | CreateEvalGuardrailConfigNumber$Outbound;
4200
1041
 
4201
1042
  /** @internal */
4202
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMNumber$inboundSchema:
4203
- z.ZodType<
4204
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMNumber,
4205
- z.ZodTypeDef,
4206
- unknown
4207
- > = z.object({
4208
- enabled: z.boolean().default(true),
4209
- alert_on_failure: z.boolean().default(false),
4210
- type: z.literal("number"),
4211
- value: z.number(),
4212
- operator:
4213
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMOperator$inboundSchema,
4214
- }).transform((v) => {
4215
- return remap$(v, {
4216
- "alert_on_failure": "alertOnFailure",
4217
- });
4218
- });
1043
+ export const CreateEvalLLMGuardrailConfig$outboundSchema: z.ZodType<
1044
+ CreateEvalLLMGuardrailConfig$Outbound,
1045
+ z.ZodTypeDef,
1046
+ CreateEvalLLMGuardrailConfig
1047
+ > = z.union([
1048
+ z.lazy(() => CreateEvalGuardrailConfigBoolean$outboundSchema),
1049
+ z.lazy(() => CreateEvalGuardrailConfigCategorical$outboundSchema),
1050
+ z.lazy(() => CreateEvalGuardrailConfigNumber$outboundSchema),
1051
+ ]);
4219
1052
 
4220
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMNumberFromJSON(
4221
- jsonString: string,
4222
- ): SafeParseResult<
4223
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMNumber,
4224
- SDKValidationError
4225
- > {
4226
- return safeParse(
4227
- jsonString,
4228
- (x) =>
4229
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMNumber$inboundSchema
4230
- .parse(JSON.parse(x)),
4231
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMNumber' from JSON`,
1053
+ export function createEvalLLMGuardrailConfigToJSON(
1054
+ createEvalLLMGuardrailConfig: CreateEvalLLMGuardrailConfig,
1055
+ ): string {
1056
+ return JSON.stringify(
1057
+ CreateEvalLLMGuardrailConfig$outboundSchema.parse(
1058
+ createEvalLLMGuardrailConfig,
1059
+ ),
4232
1060
  );
4233
1061
  }
4234
1062
 
4235
1063
  /** @internal */
4236
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMCategorical$inboundSchema:
4237
- z.ZodType<
4238
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMCategorical,
4239
- z.ZodTypeDef,
4240
- unknown
4241
- > = z.object({
4242
- enabled: z.boolean().default(true),
4243
- alert_on_failure: z.boolean().default(false),
4244
- type: z.literal("categorical"),
4245
- values: z.array(z.string()),
4246
- }).transform((v) => {
4247
- return remap$(v, {
4248
- "alert_on_failure": "alertOnFailure",
4249
- });
4250
- });
4251
-
4252
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMCategoricalFromJSON(
4253
- jsonString: string,
4254
- ): SafeParseResult<
4255
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMCategorical,
4256
- SDKValidationError
4257
- > {
4258
- return safeParse(
4259
- jsonString,
4260
- (x) =>
4261
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMCategorical$inboundSchema
4262
- .parse(JSON.parse(x)),
4263
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMCategorical' from JSON`,
4264
- );
4265
- }
1064
+ export const CreateEvalLLMOutputType$outboundSchema: z.ZodNativeEnum<
1065
+ typeof CreateEvalLLMOutputType
1066
+ > = z.nativeEnum(CreateEvalLLMOutputType);
4266
1067
 
4267
1068
  /** @internal */
4268
- export const CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMBoolean$inboundSchema:
4269
- z.ZodType<
4270
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMBoolean,
4271
- z.ZodTypeDef,
4272
- unknown
4273
- > = z.object({
4274
- enabled: z.boolean().default(true),
4275
- alert_on_failure: z.boolean().default(false),
4276
- type: z.literal("boolean"),
4277
- value: z.boolean(),
4278
- }).transform((v) => {
4279
- return remap$(v, {
4280
- "alert_on_failure": "alertOnFailure",
4281
- });
4282
- });
1069
+ export const CreateEvalLLMType$outboundSchema: z.ZodNativeEnum<
1070
+ typeof CreateEvalLLMType
1071
+ > = z.nativeEnum(CreateEvalLLMType);
4283
1072
 
4284
- export function createEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMBooleanFromJSON(
4285
- jsonString: string,
4286
- ): SafeParseResult<
4287
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMBoolean,
4288
- SDKValidationError
4289
- > {
4290
- return safeParse(
4291
- jsonString,
4292
- (x) =>
4293
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMBoolean$inboundSchema
4294
- .parse(JSON.parse(x)),
4295
- `Failed to parse 'CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMBoolean' from JSON`,
4296
- );
4297
- }
1073
+ /** @internal */
1074
+ export type CreateEvalLLMCategoricalLabels$Outbound = {
1075
+ value: string;
1076
+ description?: string | undefined;
1077
+ };
4298
1078
 
4299
1079
  /** @internal */
4300
- export const CreateEvalLLMEvalsGuardrailConfig$inboundSchema: z.ZodType<
4301
- CreateEvalLLMEvalsGuardrailConfig,
1080
+ export const CreateEvalLLMCategoricalLabels$outboundSchema: z.ZodType<
1081
+ CreateEvalLLMCategoricalLabels$Outbound,
4302
1082
  z.ZodTypeDef,
4303
- unknown
4304
- > = z.union([
4305
- z.lazy(() =>
4306
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMBoolean$inboundSchema
4307
- ),
4308
- z.lazy(() =>
4309
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMCategorical$inboundSchema
4310
- ),
4311
- z.lazy(() =>
4312
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMNumber$inboundSchema
4313
- ),
4314
- ]);
1083
+ CreateEvalLLMCategoricalLabels
1084
+ > = z.object({
1085
+ value: z.string(),
1086
+ description: z.string().optional(),
1087
+ });
4315
1088
 
4316
- export function createEvalLLMEvalsGuardrailConfigFromJSON(
4317
- jsonString: string,
4318
- ): SafeParseResult<CreateEvalLLMEvalsGuardrailConfig, SDKValidationError> {
4319
- return safeParse(
4320
- jsonString,
4321
- (x) => CreateEvalLLMEvalsGuardrailConfig$inboundSchema.parse(JSON.parse(x)),
4322
- `Failed to parse 'CreateEvalLLMEvalsGuardrailConfig' from JSON`,
1089
+ export function createEvalLLMCategoricalLabelsToJSON(
1090
+ createEvalLLMCategoricalLabels: CreateEvalLLMCategoricalLabels,
1091
+ ): string {
1092
+ return JSON.stringify(
1093
+ CreateEvalLLMCategoricalLabels$outboundSchema.parse(
1094
+ createEvalLLMCategoricalLabels,
1095
+ ),
4323
1096
  );
4324
1097
  }
4325
1098
 
4326
1099
  /** @internal */
4327
- export const CreateEvalLLMEvalsType$inboundSchema: z.ZodNativeEnum<
4328
- typeof CreateEvalLLMEvalsType
4329
- > = z.nativeEnum(CreateEvalLLMEvalsType);
1100
+ export type Llm1$Outbound = {
1101
+ guardrail_config?:
1102
+ | CreateEvalGuardrailConfigBoolean$Outbound
1103
+ | CreateEvalGuardrailConfigCategorical$Outbound
1104
+ | CreateEvalGuardrailConfigNumber$Outbound
1105
+ | null
1106
+ | undefined;
1107
+ output_type?: string | undefined;
1108
+ type: string;
1109
+ repetitions?: number | null | undefined;
1110
+ prompt: string;
1111
+ categories?: Array<string> | null | undefined;
1112
+ categorical_labels?:
1113
+ | Array<CreateEvalLLMCategoricalLabels$Outbound>
1114
+ | null
1115
+ | undefined;
1116
+ dataset_id?: string | undefined;
1117
+ path: string;
1118
+ description: string;
1119
+ key: string;
1120
+ mode: "single";
1121
+ model: string;
1122
+ };
4330
1123
 
4331
1124
  /** @internal */
4332
- export const CreateEvalLLMEvalsResponseCategoricalLabels$inboundSchema:
4333
- z.ZodType<
4334
- CreateEvalLLMEvalsResponseCategoricalLabels,
4335
- z.ZodTypeDef,
4336
- unknown
4337
- > = z.object({
4338
- value: z.string(),
4339
- description: z.string().optional(),
1125
+ export const Llm1$outboundSchema: z.ZodType<Llm1$Outbound, z.ZodTypeDef, Llm1> =
1126
+ z.object({
1127
+ guardrailConfig: z.nullable(
1128
+ z.union([
1129
+ z.lazy(() => CreateEvalGuardrailConfigBoolean$outboundSchema),
1130
+ z.lazy(() => CreateEvalGuardrailConfigCategorical$outboundSchema),
1131
+ z.lazy(() => CreateEvalGuardrailConfigNumber$outboundSchema),
1132
+ ]),
1133
+ ).optional(),
1134
+ outputType: CreateEvalLLMOutputType$outboundSchema.optional(),
1135
+ type: CreateEvalLLMType$outboundSchema,
1136
+ repetitions: z.nullable(z.number().int()).optional(),
1137
+ prompt: z.string(),
1138
+ categories: z.nullable(z.array(z.string())).optional(),
1139
+ categoricalLabels: z.nullable(
1140
+ z.array(z.lazy(() => CreateEvalLLMCategoricalLabels$outboundSchema)),
1141
+ ).optional(),
1142
+ datasetId: z.string().optional(),
1143
+ path: z.string(),
1144
+ description: z.string().default(""),
1145
+ key: z.string(),
1146
+ mode: z.literal("single"),
1147
+ model: z.string(),
1148
+ }).transform((v) => {
1149
+ return remap$(v, {
1150
+ guardrailConfig: "guardrail_config",
1151
+ outputType: "output_type",
1152
+ categoricalLabels: "categorical_labels",
1153
+ datasetId: "dataset_id",
1154
+ });
4340
1155
  });
4341
1156
 
4342
- export function createEvalLLMEvalsResponseCategoricalLabelsFromJSON(
4343
- jsonString: string,
4344
- ): SafeParseResult<
4345
- CreateEvalLLMEvalsResponseCategoricalLabels,
4346
- SDKValidationError
4347
- > {
4348
- return safeParse(
4349
- jsonString,
4350
- (x) =>
4351
- CreateEvalLLMEvalsResponseCategoricalLabels$inboundSchema.parse(
4352
- JSON.parse(x),
4353
- ),
4354
- `Failed to parse 'CreateEvalLLMEvalsResponseCategoricalLabels' from JSON`,
4355
- );
1157
+ export function llm1ToJSON(llm1: Llm1): string {
1158
+ return JSON.stringify(Llm1$outboundSchema.parse(llm1));
4356
1159
  }
4357
1160
 
4358
1161
  /** @internal */
4359
- export const CreateEvalLlm1$inboundSchema: z.ZodType<
4360
- CreateEvalLlm1,
4361
- z.ZodTypeDef,
4362
- unknown
4363
- > = z.object({
4364
- _id: z.string(),
4365
- description: z.string(),
4366
- created: z.string().default("2026-06-26T19:19:38.900Z"),
4367
- updated: z.string().default("2026-06-26T19:19:38.900Z"),
4368
- updated_by_id: z.nullable(z.string()).optional(),
4369
- guardrail_config: z.nullable(
4370
- z.union([
4371
- z.lazy(() =>
4372
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMBoolean$inboundSchema
4373
- ),
4374
- z.lazy(() =>
4375
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMCategorical$inboundSchema
4376
- ),
4377
- z.lazy(() =>
4378
- CreateEvalGuardrailConfigEvalsResponse200ApplicationJSONResponseBody1LLMNumber$inboundSchema
4379
- ),
4380
- ]),
4381
- ).optional(),
4382
- type: CreateEvalLLMEvalsType$inboundSchema,
4383
- repetitions: z.nullable(z.number().int()).optional(),
4384
- prompt: z.string(),
4385
- categories: z.nullable(z.array(z.string())).optional(),
4386
- categorical_labels: z.nullable(
4387
- z.array(z.lazy(() =>
4388
- CreateEvalLLMEvalsResponseCategoricalLabels$inboundSchema
4389
- )),
4390
- ).optional(),
4391
- dataset_id: z.string().optional(),
4392
- key: z.string(),
4393
- mode: z.literal("single"),
4394
- model: z.string(),
4395
- }).transform((v) => {
4396
- return remap$(v, {
4397
- "_id": "id",
4398
- "updated_by_id": "updatedById",
4399
- "guardrail_config": "guardrailConfig",
4400
- "categorical_labels": "categoricalLabels",
4401
- "dataset_id": "datasetId",
4402
- });
4403
- });
1162
+ export type Llm$Outbound = Llm1$Outbound | Llm2$Outbound;
4404
1163
 
4405
- export function createEvalLLM1FromJSON(
4406
- jsonString: string,
4407
- ): SafeParseResult<CreateEvalLlm1, SDKValidationError> {
4408
- return safeParse(
4409
- jsonString,
4410
- (x) => CreateEvalLlm1$inboundSchema.parse(JSON.parse(x)),
4411
- `Failed to parse 'CreateEvalLlm1' from JSON`,
4412
- );
1164
+ /** @internal */
1165
+ export const Llm$outboundSchema: z.ZodType<Llm$Outbound, z.ZodTypeDef, Llm> = z
1166
+ .union([
1167
+ z.lazy(() => Llm1$outboundSchema),
1168
+ z.lazy(() => Llm2$outboundSchema),
1169
+ ]);
1170
+
1171
+ export function llmToJSON(llm: Llm): string {
1172
+ return JSON.stringify(Llm$outboundSchema.parse(llm));
4413
1173
  }
4414
1174
 
4415
1175
  /** @internal */
4416
- export const ResponseBodyLLM$inboundSchema: z.ZodType<
4417
- ResponseBodyLLM,
1176
+ export type CreateEvalRequestBody$Outbound =
1177
+ | Python$Outbound
1178
+ | Llm1$Outbound
1179
+ | Llm2$Outbound;
1180
+
1181
+ /** @internal */
1182
+ export const CreateEvalRequestBody$outboundSchema: z.ZodType<
1183
+ CreateEvalRequestBody$Outbound,
4418
1184
  z.ZodTypeDef,
4419
- unknown
1185
+ CreateEvalRequestBody
4420
1186
  > = z.union([
4421
- z.lazy(() => CreateEvalLlm1$inboundSchema),
4422
- z.lazy(() => CreateEvalLlm2$inboundSchema),
1187
+ z.lazy(() => Python$outboundSchema),
1188
+ z.union([
1189
+ z.lazy(() => Llm1$outboundSchema),
1190
+ z.lazy(() => Llm2$outboundSchema),
1191
+ ]),
4423
1192
  ]);
4424
1193
 
4425
- export function responseBodyLLMFromJSON(
4426
- jsonString: string,
4427
- ): SafeParseResult<ResponseBodyLLM, SDKValidationError> {
4428
- return safeParse(
4429
- jsonString,
4430
- (x) => ResponseBodyLLM$inboundSchema.parse(JSON.parse(x)),
4431
- `Failed to parse 'ResponseBodyLLM' from JSON`,
1194
+ export function createEvalRequestBodyToJSON(
1195
+ createEvalRequestBody: CreateEvalRequestBody,
1196
+ ): string {
1197
+ return JSON.stringify(
1198
+ CreateEvalRequestBody$outboundSchema.parse(createEvalRequestBody),
4432
1199
  );
4433
1200
  }
4434
1201
 
@@ -4438,16 +1205,13 @@ export const CreateEvalResponseBody$inboundSchema: z.ZodType<
4438
1205
  z.ZodTypeDef,
4439
1206
  unknown
4440
1207
  > = z.union([
4441
- z.lazy(() => CreateEvalResponseBodyHTTP$inboundSchema),
4442
- z.lazy(() => Ragas$inboundSchema),
4443
- z.lazy(() => Json$inboundSchema),
4444
- z.lazy(() => ResponseBodyPython$inboundSchema),
4445
- z.lazy(() => CreateEvalResponseBodyFunction$inboundSchema),
4446
- z.lazy(() => Typescript$inboundSchema),
4447
- z.union([
4448
- z.lazy(() => CreateEvalLlm1$inboundSchema),
4449
- z.lazy(() => CreateEvalLlm2$inboundSchema),
4450
- ]),
1208
+ components.EvaluatorResponseLlm$inboundSchema,
1209
+ components.EvaluatorResponseJsonSchema$inboundSchema,
1210
+ components.EvaluatorResponseHttp$inboundSchema,
1211
+ components.EvaluatorResponsePython$inboundSchema,
1212
+ components.EvaluatorResponseFunction$inboundSchema,
1213
+ components.EvaluatorResponseRagas$inboundSchema,
1214
+ components.EvaluatorResponseTypescript$inboundSchema,
4451
1215
  ]);
4452
1216
 
4453
1217
  export function createEvalResponseBodyFromJSON(