@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.
- package/funcs/knowledgeList.js +1 -0
- package/funcs/knowledgeList.js.map +1 -1
- package/funcs/memoryStoresList.js +1 -0
- package/funcs/memoryStoresList.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/createskillrequest.d.ts +6 -6
- package/models/components/createskillrequest.d.ts.map +1 -1
- package/models/components/createskillrequest.js +6 -7
- package/models/components/createskillrequest.js.map +1 -1
- package/models/components/evaluatorresponsefunction.d.ts +270 -0
- package/models/components/evaluatorresponsefunction.d.ts.map +1 -0
- package/models/components/evaluatorresponsefunction.js +491 -0
- package/models/components/evaluatorresponsefunction.js.map +1 -0
- package/models/components/evaluatorresponsehttp.d.ts +76 -0
- package/models/components/evaluatorresponsehttp.d.ts.map +1 -0
- package/models/components/evaluatorresponsehttp.js +146 -0
- package/models/components/evaluatorresponsehttp.js.map +1 -0
- package/models/components/evaluatorresponsejsonschema.d.ts +62 -0
- package/models/components/evaluatorresponsejsonschema.d.ts.map +1 -0
- package/models/components/evaluatorresponsejsonschema.js +135 -0
- package/models/components/evaluatorresponsejsonschema.js.map +1 -0
- package/models/components/evaluatorresponsellm.d.ts +140 -0
- package/models/components/evaluatorresponsellm.d.ts.map +1 -0
- package/models/components/evaluatorresponsellm.js +250 -0
- package/models/components/evaluatorresponsellm.js.map +1 -0
- package/models/components/evaluatorresponsepython.d.ts +62 -0
- package/models/components/evaluatorresponsepython.d.ts.map +1 -0
- package/models/components/evaluatorresponsepython.js +136 -0
- package/models/components/evaluatorresponsepython.js.map +1 -0
- package/models/components/evaluatorresponseragas.d.ts +80 -0
- package/models/components/evaluatorresponseragas.d.ts.map +1 -0
- package/models/components/evaluatorresponseragas.js +155 -0
- package/models/components/evaluatorresponseragas.js.map +1 -0
- package/models/components/evaluatorresponsetypescript.d.ts +62 -0
- package/models/components/evaluatorresponsetypescript.d.ts.map +1 -0
- package/models/components/evaluatorresponsetypescript.js +136 -0
- package/models/components/evaluatorresponsetypescript.js.map +1 -0
- package/models/components/guardrailrule.d.ts +2 -0
- package/models/components/guardrailrule.d.ts.map +1 -1
- package/models/components/guardrailrule.js +2 -0
- package/models/components/guardrailrule.js.map +1 -1
- package/models/components/index.d.ts +13 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +13 -0
- package/models/components/index.js.map +1 -1
- package/models/components/invokedeploymentrequest.d.ts +36 -36
- package/models/components/invokedeploymentrequest.d.ts.map +1 -1
- package/models/components/invokedeploymentrequest.js +33 -34
- package/models/components/invokedeploymentrequest.js.map +1 -1
- package/models/components/modelsconfig.d.ts +5 -5
- package/models/components/modelsconfig.d.ts.map +1 -1
- package/models/components/modelsconfig.js +6 -6
- package/models/components/modelsconfig.js.map +1 -1
- package/models/components/piiredactionplugin.d.ts +14 -0
- package/models/components/piiredactionplugin.d.ts.map +1 -0
- package/models/components/piiredactionplugin.js +59 -0
- package/models/components/piiredactionplugin.js.map +1 -0
- package/models/components/piiredactionpluginauto.d.ts +127 -0
- package/models/components/piiredactionpluginauto.d.ts.map +1 -0
- package/models/components/piiredactionpluginauto.js +157 -0
- package/models/components/piiredactionpluginauto.js.map +1 -0
- package/models/components/piiredactionpluginen.d.ts +146 -0
- package/models/components/piiredactionpluginen.d.ts.map +1 -0
- package/models/components/piiredactionpluginen.js +168 -0
- package/models/components/piiredactionpluginen.js.map +1 -0
- package/models/components/piiredactionpluginnl.d.ts +138 -0
- package/models/components/piiredactionpluginnl.d.ts.map +1 -0
- package/models/components/piiredactionpluginnl.js +159 -0
- package/models/components/piiredactionpluginnl.js.map +1 -0
- package/models/components/plugin.d.ts +11 -0
- package/models/components/plugin.d.ts.map +1 -0
- package/models/components/plugin.js +57 -0
- package/models/components/plugin.js.map +1 -0
- package/models/components/publicpiiredactionplugin.d.ts +79 -0
- package/models/components/publicpiiredactionplugin.d.ts.map +1 -0
- package/models/components/publicpiiredactionplugin.js +86 -0
- package/models/components/publicpiiredactionplugin.js.map +1 -0
- package/models/components/reasoningpart.js +1 -1
- package/models/components/textcontentpartschema.d.ts +10 -10
- package/models/components/textcontentpartschema.d.ts.map +1 -1
- package/models/components/textcontentpartschema.js +11 -11
- package/models/components/textcontentpartschema.js.map +1 -1
- package/models/operations/createagentrequest.d.ts +38 -0
- package/models/operations/createagentrequest.d.ts.map +1 -1
- package/models/operations/createagentrequest.js +65 -5
- package/models/operations/createagentrequest.js.map +1 -1
- package/models/operations/createchatcompletion.d.ts +11 -0
- package/models/operations/createchatcompletion.d.ts.map +1 -1
- package/models/operations/createchatcompletion.js +18 -3
- package/models/operations/createchatcompletion.js.map +1 -1
- package/models/operations/createcompletion.d.ts +11 -0
- package/models/operations/createcompletion.d.ts.map +1 -1
- package/models/operations/createcompletion.js +18 -3
- package/models/operations/createcompletion.js.map +1 -1
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +4 -4
- package/models/operations/createdatasource.js +1 -1
- package/models/operations/createeval.d.ts +22 -852
- package/models/operations/createeval.d.ts.map +1 -1
- package/models/operations/createeval.js +30 -1341
- package/models/operations/createeval.js.map +1 -1
- package/models/operations/createimage.d.ts +11 -0
- package/models/operations/createimage.d.ts.map +1 -1
- package/models/operations/createimage.js +16 -1
- package/models/operations/createimage.js.map +1 -1
- package/models/operations/createprompt.d.ts +27 -8
- package/models/operations/createprompt.d.ts.map +1 -1
- package/models/operations/createprompt.js +42 -12
- package/models/operations/createprompt.js.map +1 -1
- package/models/operations/creatererank.d.ts +11 -0
- package/models/operations/creatererank.d.ts.map +1 -1
- package/models/operations/creatererank.js +16 -1
- package/models/operations/creatererank.js.map +1 -1
- package/models/operations/createrouterresponse.d.ts +5 -0
- package/models/operations/createrouterresponse.d.ts.map +1 -1
- package/models/operations/createrouterresponse.js +1 -0
- package/models/operations/createrouterresponse.js.map +1 -1
- package/models/operations/createtool.d.ts +8 -8
- package/models/operations/createtool.d.ts.map +1 -1
- package/models/operations/createtool.js +16 -16
- package/models/operations/createtool.js.map +1 -1
- package/models/operations/deploymentgetconfig.d.ts +8 -8
- package/models/operations/deploymentgetconfig.d.ts.map +1 -1
- package/models/operations/deploymentgetconfig.js +10 -10
- package/models/operations/deploymentgetconfig.js.map +1 -1
- package/models/operations/getallmemorystores.d.ts +5 -0
- package/models/operations/getallmemorystores.d.ts.map +1 -1
- package/models/operations/getallmemorystores.js +2 -0
- package/models/operations/getallmemorystores.js.map +1 -1
- package/models/operations/getallprompts.d.ts +8 -0
- package/models/operations/getallprompts.d.ts.map +1 -1
- package/models/operations/getallprompts.js +16 -1
- package/models/operations/getallprompts.js.map +1 -1
- package/models/operations/getalltools.d.ts +20 -20
- package/models/operations/getalltools.d.ts.map +1 -1
- package/models/operations/getalltools.js +28 -26
- package/models/operations/getalltools.js.map +1 -1
- package/models/operations/getevals.d.ts +3 -833
- package/models/operations/getevals.d.ts.map +1 -1
- package/models/operations/getevals.js +16 -1314
- package/models/operations/getevals.js.map +1 -1
- package/models/operations/getoneprompt.d.ts +8 -0
- package/models/operations/getoneprompt.d.ts.map +1 -1
- package/models/operations/getoneprompt.js +17 -2
- package/models/operations/getoneprompt.js.map +1 -1
- package/models/operations/getpromptversion.d.ts +8 -0
- package/models/operations/getpromptversion.d.ts.map +1 -1
- package/models/operations/getpromptversion.js +17 -2
- package/models/operations/getpromptversion.js.map +1 -1
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/guardrailrulecreate.d.ts +1 -0
- package/models/operations/guardrailrulecreate.d.ts.map +1 -1
- package/models/operations/guardrailrulecreate.js +1 -0
- package/models/operations/guardrailrulecreate.js.map +1 -1
- package/models/operations/guardrailruleget.d.ts +1 -0
- package/models/operations/guardrailruleget.d.ts.map +1 -1
- package/models/operations/guardrailruleget.js +1 -0
- package/models/operations/guardrailruleget.js.map +1 -1
- package/models/operations/guardrailruleupdate.d.ts +1 -0
- package/models/operations/guardrailruleupdate.d.ts.map +1 -1
- package/models/operations/guardrailruleupdate.js +1 -0
- package/models/operations/guardrailruleupdate.js.map +1 -1
- package/models/operations/invokeeval.d.ts +7 -7
- package/models/operations/invokeeval.d.ts.map +1 -1
- package/models/operations/invokeeval.js +11 -11
- package/models/operations/invokeeval.js.map +1 -1
- package/models/operations/listagents.d.ts +16 -0
- package/models/operations/listagents.d.ts.map +1 -1
- package/models/operations/listagents.js +32 -2
- package/models/operations/listagents.js.map +1 -1
- package/models/operations/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/listknowledgebases.d.ts +5 -0
- package/models/operations/listknowledgebases.d.ts.map +1 -1
- package/models/operations/listknowledgebases.js +2 -0
- package/models/operations/listknowledgebases.js.map +1 -1
- package/models/operations/listpromptversions.d.ts +8 -0
- package/models/operations/listpromptversions.d.ts.map +1 -1
- package/models/operations/listpromptversions.js +17 -2
- package/models/operations/listpromptversions.js.map +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/postv2feedbackevaluation.js +3 -3
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrieveagentrequest.d.ts +16 -0
- package/models/operations/retrieveagentrequest.d.ts.map +1 -1
- package/models/operations/retrieveagentrequest.js +32 -2
- package/models/operations/retrieveagentrequest.js.map +1 -1
- package/models/operations/retrievedatapoint.js +4 -4
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievedatasource.js +1 -1
- package/models/operations/retrievetool.js +6 -6
- package/models/operations/runagent.d.ts +22 -0
- package/models/operations/runagent.d.ts.map +1 -1
- package/models/operations/runagent.js +34 -4
- package/models/operations/runagent.js.map +1 -1
- package/models/operations/streamrunagent.d.ts +22 -0
- package/models/operations/streamrunagent.d.ts.map +1 -1
- package/models/operations/streamrunagent.js +34 -4
- package/models/operations/streamrunagent.js.map +1 -1
- package/models/operations/updateagent.d.ts +38 -0
- package/models/operations/updateagent.d.ts.map +1 -1
- package/models/operations/updateagent.js +65 -5
- package/models/operations/updateagent.js.map +1 -1
- package/models/operations/updatedatapoint.js +4 -4
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatedatasource.js +1 -1
- package/models/operations/updateeval.d.ts +2 -832
- package/models/operations/updateeval.d.ts.map +1 -1
- package/models/operations/updateeval.js +9 -1304
- package/models/operations/updateeval.js.map +1 -1
- package/models/operations/updateprompt.d.ts +19 -0
- package/models/operations/updateprompt.d.ts.map +1 -1
- package/models/operations/updateprompt.js +33 -3
- package/models/operations/updateprompt.js.map +1 -1
- package/models/operations/updatetool.js +7 -7
- package/package.json +7 -7
- package/sdk/feedback.d.ts +2 -2
- package/sdk/feedback.js +2 -2
- package/src/funcs/knowledgeList.ts +1 -0
- package/src/funcs/memoryStoresList.ts +1 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/createskillrequest.ts +27 -20
- package/src/models/components/evaluatorresponsefunction.ts +1107 -0
- package/src/models/components/evaluatorresponsehttp.ts +247 -0
- package/src/models/components/evaluatorresponsejsonschema.ts +214 -0
- package/src/models/components/evaluatorresponsellm.ts +442 -0
- package/src/models/components/evaluatorresponsepython.ts +234 -0
- package/src/models/components/evaluatorresponseragas.ts +257 -0
- package/src/models/components/evaluatorresponsetypescript.ts +247 -0
- package/src/models/components/guardrailrule.ts +3 -0
- package/src/models/components/index.ts +13 -0
- package/src/models/components/invokedeploymentrequest.ts +119 -95
- package/src/models/components/modelsconfig.ts +11 -10
- package/src/models/components/piiredactionplugin.ts +44 -0
- package/src/models/components/piiredactionpluginauto.ts +186 -0
- package/src/models/components/piiredactionpluginen.ts +223 -0
- package/src/models/components/piiredactionpluginnl.ts +219 -0
- package/src/models/components/plugin.ts +37 -0
- package/src/models/components/publicpiiredactionplugin.ts +127 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/components/textcontentpartschema.ts +23 -19
- package/src/models/operations/createagentrequest.ts +199 -0
- package/src/models/operations/createchatcompletion.ts +56 -0
- package/src/models/operations/createcompletion.ts +54 -0
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +4 -4
- package/src/models/operations/createdatasource.ts +1 -1
- package/src/models/operations/createeval.ts +673 -3909
- package/src/models/operations/createimage.ts +54 -0
- package/src/models/operations/createprompt.ts +115 -22
- package/src/models/operations/creatererank.ts +54 -0
- package/src/models/operations/createrouterresponse.ts +11 -0
- package/src/models/operations/createtool.ts +22 -24
- package/src/models/operations/deploymentgetconfig.ts +16 -18
- package/src/models/operations/getallmemorystores.ts +7 -0
- package/src/models/operations/getallprompts.ts +43 -0
- package/src/models/operations/getalltools.ts +47 -53
- package/src/models/operations/getevals.ts +29 -3214
- package/src/models/operations/getoneprompt.ts +43 -0
- package/src/models/operations/getpromptversion.ts +43 -0
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/guardrailrulecreate.ts +2 -0
- package/src/models/operations/guardrailruleget.ts +2 -0
- package/src/models/operations/guardrailruleupdate.ts +2 -0
- package/src/models/operations/invokeeval.ts +18 -18
- package/src/models/operations/listagents.ts +93 -0
- package/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/listdatasources.ts +1 -1
- package/src/models/operations/listknowledgebases.ts +7 -0
- package/src/models/operations/listpromptversions.ts +43 -0
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/postv2feedbackevaluation.ts +3 -3
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrieveagentrequest.ts +93 -0
- package/src/models/operations/retrievedatapoint.ts +4 -4
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrievedatasource.ts +1 -1
- package/src/models/operations/retrievetool.ts +6 -6
- package/src/models/operations/runagent.ts +115 -1
- package/src/models/operations/streamrunagent.ts +116 -1
- package/src/models/operations/updateagent.ts +205 -0
- package/src/models/operations/updatedatapoint.ts +4 -4
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatedatasource.ts +1 -1
- package/src/models/operations/updateeval.ts +306 -3524
- package/src/models/operations/updateprompt.ts +97 -0
- package/src/models/operations/updatetool.ts +7 -7
- package/src/sdk/feedback.ts +2 -2
|
@@ -0,0 +1,1107 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export const EvaluatorResponseFunctionGuardrailConfigOperator = {
|
|
13
|
+
Eq: "eq",
|
|
14
|
+
Ne: "ne",
|
|
15
|
+
Gt: "gt",
|
|
16
|
+
Gte: "gte",
|
|
17
|
+
Lt: "lt",
|
|
18
|
+
Lte: "lte",
|
|
19
|
+
} as const;
|
|
20
|
+
export type EvaluatorResponseFunctionGuardrailConfigOperator = ClosedEnum<
|
|
21
|
+
typeof EvaluatorResponseFunctionGuardrailConfigOperator
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
export type EvaluatorResponseFunctionGuardrailConfigNumber = {
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
alertOnFailure: boolean;
|
|
27
|
+
type: "number";
|
|
28
|
+
value: number;
|
|
29
|
+
operator: EvaluatorResponseFunctionGuardrailConfigOperator;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type EvaluatorResponseFunctionGuardrailConfigCategorical = {
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
alertOnFailure: boolean;
|
|
35
|
+
type: "categorical";
|
|
36
|
+
values: Array<string>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type EvaluatorResponseFunctionGuardrailConfigBoolean = {
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
alertOnFailure: boolean;
|
|
42
|
+
type: "boolean";
|
|
43
|
+
value: boolean;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type EvaluatorResponseFunctionGuardrailConfig =
|
|
47
|
+
| EvaluatorResponseFunctionGuardrailConfigBoolean
|
|
48
|
+
| EvaluatorResponseFunctionGuardrailConfigCategorical
|
|
49
|
+
| EvaluatorResponseFunctionGuardrailConfigNumber;
|
|
50
|
+
|
|
51
|
+
export type ThirtyTwo = {
|
|
52
|
+
type: "grammar_diversity";
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type ThirtyOne = {
|
|
56
|
+
type: "lexical_repetition";
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type Thirty = {
|
|
60
|
+
type: "sentences_count";
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type TwentyNine = {
|
|
64
|
+
type: "words_count";
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type TwentyEight = {
|
|
68
|
+
type: "gse_english_level";
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type TwentySeven = {
|
|
72
|
+
type: "flesch_reading_ease";
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export type TwentySix = {
|
|
76
|
+
type: "most_repeated_words";
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type TwentyFive = {
|
|
80
|
+
type: "keywords_match";
|
|
81
|
+
keywords: Array<string>;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export type TwentyFour = {
|
|
85
|
+
type: "levenshtein_distance";
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type TwentyThree = {
|
|
89
|
+
type: "cosine_similarity";
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type TwentyTwo = {
|
|
93
|
+
type: "meteor_score";
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type TwentyOne = {
|
|
97
|
+
type: "rouge_n";
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type Twenty = {
|
|
101
|
+
type: "bleu_score";
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export type Nineteen = {
|
|
105
|
+
type: "bert_score";
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export type Eighteen = {
|
|
109
|
+
type: "moderations_google";
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export type Seventeen = {
|
|
113
|
+
type: "moderations_openai";
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export type Sixteen = {
|
|
117
|
+
type: "is_valid_json";
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export type Fifteen = {
|
|
121
|
+
type: "regex";
|
|
122
|
+
pattern: string;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export type Fourteen = {
|
|
126
|
+
type: "one_line";
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export type Thirteen = {
|
|
130
|
+
type: "length_greater_than";
|
|
131
|
+
value: number;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export type Twelve = {
|
|
135
|
+
type: "length_between";
|
|
136
|
+
min: number;
|
|
137
|
+
max: number;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export type Eleven = {
|
|
141
|
+
type: "length_less_than";
|
|
142
|
+
value: number;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export type Ten = {
|
|
146
|
+
type: "exact_match";
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export type Nine = {
|
|
150
|
+
type: "ends_with";
|
|
151
|
+
value: string;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export type Eight = {
|
|
155
|
+
type: "start_with";
|
|
156
|
+
value: string;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export type Seven = {
|
|
160
|
+
type: "contains_valid_link";
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export type Six = {
|
|
164
|
+
type: "contains_url";
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export type Five = {
|
|
168
|
+
type: "contains_email";
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export type Four = {
|
|
172
|
+
type: "contains_any";
|
|
173
|
+
keywords: Array<string>;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export type Three = {
|
|
177
|
+
type: "contains_all";
|
|
178
|
+
keywords: Array<string>;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export type Two = {
|
|
182
|
+
type: "contains_none";
|
|
183
|
+
keywords: Array<string>;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export type One = {
|
|
187
|
+
type: "contains";
|
|
188
|
+
value: string;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export type FunctionParams =
|
|
192
|
+
| One
|
|
193
|
+
| Two
|
|
194
|
+
| Three
|
|
195
|
+
| Four
|
|
196
|
+
| Five
|
|
197
|
+
| Six
|
|
198
|
+
| Seven
|
|
199
|
+
| Eight
|
|
200
|
+
| Nine
|
|
201
|
+
| Ten
|
|
202
|
+
| Eleven
|
|
203
|
+
| Twelve
|
|
204
|
+
| Thirteen
|
|
205
|
+
| Fourteen
|
|
206
|
+
| Fifteen
|
|
207
|
+
| Sixteen
|
|
208
|
+
| Seventeen
|
|
209
|
+
| Eighteen
|
|
210
|
+
| Nineteen
|
|
211
|
+
| Twenty
|
|
212
|
+
| TwentyOne
|
|
213
|
+
| TwentyTwo
|
|
214
|
+
| TwentyThree
|
|
215
|
+
| TwentyFour
|
|
216
|
+
| TwentyFive
|
|
217
|
+
| TwentySix
|
|
218
|
+
| TwentySeven
|
|
219
|
+
| TwentyEight
|
|
220
|
+
| TwentyNine
|
|
221
|
+
| Thirty
|
|
222
|
+
| ThirtyOne
|
|
223
|
+
| ThirtyTwo;
|
|
224
|
+
|
|
225
|
+
export type EvaluatorResponseFunction = {
|
|
226
|
+
id: string;
|
|
227
|
+
description: string;
|
|
228
|
+
created: string;
|
|
229
|
+
updated: string;
|
|
230
|
+
updatedById?: string | null | undefined;
|
|
231
|
+
guardrailConfig?:
|
|
232
|
+
| EvaluatorResponseFunctionGuardrailConfigBoolean
|
|
233
|
+
| EvaluatorResponseFunctionGuardrailConfigCategorical
|
|
234
|
+
| EvaluatorResponseFunctionGuardrailConfigNumber
|
|
235
|
+
| null
|
|
236
|
+
| undefined;
|
|
237
|
+
type: "function_eval";
|
|
238
|
+
functionParams:
|
|
239
|
+
| One
|
|
240
|
+
| Two
|
|
241
|
+
| Three
|
|
242
|
+
| Four
|
|
243
|
+
| Five
|
|
244
|
+
| Six
|
|
245
|
+
| Seven
|
|
246
|
+
| Eight
|
|
247
|
+
| Nine
|
|
248
|
+
| Ten
|
|
249
|
+
| Eleven
|
|
250
|
+
| Twelve
|
|
251
|
+
| Thirteen
|
|
252
|
+
| Fourteen
|
|
253
|
+
| Fifteen
|
|
254
|
+
| Sixteen
|
|
255
|
+
| Seventeen
|
|
256
|
+
| Eighteen
|
|
257
|
+
| Nineteen
|
|
258
|
+
| Twenty
|
|
259
|
+
| TwentyOne
|
|
260
|
+
| TwentyTwo
|
|
261
|
+
| TwentyThree
|
|
262
|
+
| TwentyFour
|
|
263
|
+
| TwentyFive
|
|
264
|
+
| TwentySix
|
|
265
|
+
| TwentySeven
|
|
266
|
+
| TwentyEight
|
|
267
|
+
| TwentyNine
|
|
268
|
+
| Thirty
|
|
269
|
+
| ThirtyOne
|
|
270
|
+
| ThirtyTwo;
|
|
271
|
+
key: string;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/** @internal */
|
|
275
|
+
export const EvaluatorResponseFunctionGuardrailConfigOperator$inboundSchema:
|
|
276
|
+
z.ZodNativeEnum<typeof EvaluatorResponseFunctionGuardrailConfigOperator> = z
|
|
277
|
+
.nativeEnum(EvaluatorResponseFunctionGuardrailConfigOperator);
|
|
278
|
+
|
|
279
|
+
/** @internal */
|
|
280
|
+
export const EvaluatorResponseFunctionGuardrailConfigNumber$inboundSchema:
|
|
281
|
+
z.ZodType<
|
|
282
|
+
EvaluatorResponseFunctionGuardrailConfigNumber,
|
|
283
|
+
z.ZodTypeDef,
|
|
284
|
+
unknown
|
|
285
|
+
> = z.object({
|
|
286
|
+
enabled: z.boolean().default(true),
|
|
287
|
+
alert_on_failure: z.boolean().default(false),
|
|
288
|
+
type: z.literal("number"),
|
|
289
|
+
value: z.number(),
|
|
290
|
+
operator: EvaluatorResponseFunctionGuardrailConfigOperator$inboundSchema,
|
|
291
|
+
}).transform((v) => {
|
|
292
|
+
return remap$(v, {
|
|
293
|
+
"alert_on_failure": "alertOnFailure",
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
export function evaluatorResponseFunctionGuardrailConfigNumberFromJSON(
|
|
298
|
+
jsonString: string,
|
|
299
|
+
): SafeParseResult<
|
|
300
|
+
EvaluatorResponseFunctionGuardrailConfigNumber,
|
|
301
|
+
SDKValidationError
|
|
302
|
+
> {
|
|
303
|
+
return safeParse(
|
|
304
|
+
jsonString,
|
|
305
|
+
(x) =>
|
|
306
|
+
EvaluatorResponseFunctionGuardrailConfigNumber$inboundSchema.parse(
|
|
307
|
+
JSON.parse(x),
|
|
308
|
+
),
|
|
309
|
+
`Failed to parse 'EvaluatorResponseFunctionGuardrailConfigNumber' from JSON`,
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/** @internal */
|
|
314
|
+
export const EvaluatorResponseFunctionGuardrailConfigCategorical$inboundSchema:
|
|
315
|
+
z.ZodType<
|
|
316
|
+
EvaluatorResponseFunctionGuardrailConfigCategorical,
|
|
317
|
+
z.ZodTypeDef,
|
|
318
|
+
unknown
|
|
319
|
+
> = z.object({
|
|
320
|
+
enabled: z.boolean().default(true),
|
|
321
|
+
alert_on_failure: z.boolean().default(false),
|
|
322
|
+
type: z.literal("categorical"),
|
|
323
|
+
values: z.array(z.string()),
|
|
324
|
+
}).transform((v) => {
|
|
325
|
+
return remap$(v, {
|
|
326
|
+
"alert_on_failure": "alertOnFailure",
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
export function evaluatorResponseFunctionGuardrailConfigCategoricalFromJSON(
|
|
331
|
+
jsonString: string,
|
|
332
|
+
): SafeParseResult<
|
|
333
|
+
EvaluatorResponseFunctionGuardrailConfigCategorical,
|
|
334
|
+
SDKValidationError
|
|
335
|
+
> {
|
|
336
|
+
return safeParse(
|
|
337
|
+
jsonString,
|
|
338
|
+
(x) =>
|
|
339
|
+
EvaluatorResponseFunctionGuardrailConfigCategorical$inboundSchema.parse(
|
|
340
|
+
JSON.parse(x),
|
|
341
|
+
),
|
|
342
|
+
`Failed to parse 'EvaluatorResponseFunctionGuardrailConfigCategorical' from JSON`,
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/** @internal */
|
|
347
|
+
export const EvaluatorResponseFunctionGuardrailConfigBoolean$inboundSchema:
|
|
348
|
+
z.ZodType<
|
|
349
|
+
EvaluatorResponseFunctionGuardrailConfigBoolean,
|
|
350
|
+
z.ZodTypeDef,
|
|
351
|
+
unknown
|
|
352
|
+
> = z.object({
|
|
353
|
+
enabled: z.boolean().default(true),
|
|
354
|
+
alert_on_failure: z.boolean().default(false),
|
|
355
|
+
type: z.literal("boolean"),
|
|
356
|
+
value: z.boolean(),
|
|
357
|
+
}).transform((v) => {
|
|
358
|
+
return remap$(v, {
|
|
359
|
+
"alert_on_failure": "alertOnFailure",
|
|
360
|
+
});
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
export function evaluatorResponseFunctionGuardrailConfigBooleanFromJSON(
|
|
364
|
+
jsonString: string,
|
|
365
|
+
): SafeParseResult<
|
|
366
|
+
EvaluatorResponseFunctionGuardrailConfigBoolean,
|
|
367
|
+
SDKValidationError
|
|
368
|
+
> {
|
|
369
|
+
return safeParse(
|
|
370
|
+
jsonString,
|
|
371
|
+
(x) =>
|
|
372
|
+
EvaluatorResponseFunctionGuardrailConfigBoolean$inboundSchema.parse(
|
|
373
|
+
JSON.parse(x),
|
|
374
|
+
),
|
|
375
|
+
`Failed to parse 'EvaluatorResponseFunctionGuardrailConfigBoolean' from JSON`,
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/** @internal */
|
|
380
|
+
export const EvaluatorResponseFunctionGuardrailConfig$inboundSchema: z.ZodType<
|
|
381
|
+
EvaluatorResponseFunctionGuardrailConfig,
|
|
382
|
+
z.ZodTypeDef,
|
|
383
|
+
unknown
|
|
384
|
+
> = z.union([
|
|
385
|
+
z.lazy(() => EvaluatorResponseFunctionGuardrailConfigBoolean$inboundSchema),
|
|
386
|
+
z.lazy(() =>
|
|
387
|
+
EvaluatorResponseFunctionGuardrailConfigCategorical$inboundSchema
|
|
388
|
+
),
|
|
389
|
+
z.lazy(() => EvaluatorResponseFunctionGuardrailConfigNumber$inboundSchema),
|
|
390
|
+
]);
|
|
391
|
+
|
|
392
|
+
export function evaluatorResponseFunctionGuardrailConfigFromJSON(
|
|
393
|
+
jsonString: string,
|
|
394
|
+
): SafeParseResult<
|
|
395
|
+
EvaluatorResponseFunctionGuardrailConfig,
|
|
396
|
+
SDKValidationError
|
|
397
|
+
> {
|
|
398
|
+
return safeParse(
|
|
399
|
+
jsonString,
|
|
400
|
+
(x) =>
|
|
401
|
+
EvaluatorResponseFunctionGuardrailConfig$inboundSchema.parse(
|
|
402
|
+
JSON.parse(x),
|
|
403
|
+
),
|
|
404
|
+
`Failed to parse 'EvaluatorResponseFunctionGuardrailConfig' from JSON`,
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/** @internal */
|
|
409
|
+
export const ThirtyTwo$inboundSchema: z.ZodType<
|
|
410
|
+
ThirtyTwo,
|
|
411
|
+
z.ZodTypeDef,
|
|
412
|
+
unknown
|
|
413
|
+
> = z.object({
|
|
414
|
+
type: z.literal("grammar_diversity"),
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
export function thirtyTwoFromJSON(
|
|
418
|
+
jsonString: string,
|
|
419
|
+
): SafeParseResult<ThirtyTwo, SDKValidationError> {
|
|
420
|
+
return safeParse(
|
|
421
|
+
jsonString,
|
|
422
|
+
(x) => ThirtyTwo$inboundSchema.parse(JSON.parse(x)),
|
|
423
|
+
`Failed to parse 'ThirtyTwo' from JSON`,
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/** @internal */
|
|
428
|
+
export const ThirtyOne$inboundSchema: z.ZodType<
|
|
429
|
+
ThirtyOne,
|
|
430
|
+
z.ZodTypeDef,
|
|
431
|
+
unknown
|
|
432
|
+
> = z.object({
|
|
433
|
+
type: z.literal("lexical_repetition"),
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
export function thirtyOneFromJSON(
|
|
437
|
+
jsonString: string,
|
|
438
|
+
): SafeParseResult<ThirtyOne, SDKValidationError> {
|
|
439
|
+
return safeParse(
|
|
440
|
+
jsonString,
|
|
441
|
+
(x) => ThirtyOne$inboundSchema.parse(JSON.parse(x)),
|
|
442
|
+
`Failed to parse 'ThirtyOne' from JSON`,
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/** @internal */
|
|
447
|
+
export const Thirty$inboundSchema: z.ZodType<Thirty, z.ZodTypeDef, unknown> = z
|
|
448
|
+
.object({
|
|
449
|
+
type: z.literal("sentences_count"),
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
export function thirtyFromJSON(
|
|
453
|
+
jsonString: string,
|
|
454
|
+
): SafeParseResult<Thirty, SDKValidationError> {
|
|
455
|
+
return safeParse(
|
|
456
|
+
jsonString,
|
|
457
|
+
(x) => Thirty$inboundSchema.parse(JSON.parse(x)),
|
|
458
|
+
`Failed to parse 'Thirty' from JSON`,
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/** @internal */
|
|
463
|
+
export const TwentyNine$inboundSchema: z.ZodType<
|
|
464
|
+
TwentyNine,
|
|
465
|
+
z.ZodTypeDef,
|
|
466
|
+
unknown
|
|
467
|
+
> = z.object({
|
|
468
|
+
type: z.literal("words_count"),
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
export function twentyNineFromJSON(
|
|
472
|
+
jsonString: string,
|
|
473
|
+
): SafeParseResult<TwentyNine, SDKValidationError> {
|
|
474
|
+
return safeParse(
|
|
475
|
+
jsonString,
|
|
476
|
+
(x) => TwentyNine$inboundSchema.parse(JSON.parse(x)),
|
|
477
|
+
`Failed to parse 'TwentyNine' from JSON`,
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/** @internal */
|
|
482
|
+
export const TwentyEight$inboundSchema: z.ZodType<
|
|
483
|
+
TwentyEight,
|
|
484
|
+
z.ZodTypeDef,
|
|
485
|
+
unknown
|
|
486
|
+
> = z.object({
|
|
487
|
+
type: z.literal("gse_english_level"),
|
|
488
|
+
});
|
|
489
|
+
|
|
490
|
+
export function twentyEightFromJSON(
|
|
491
|
+
jsonString: string,
|
|
492
|
+
): SafeParseResult<TwentyEight, SDKValidationError> {
|
|
493
|
+
return safeParse(
|
|
494
|
+
jsonString,
|
|
495
|
+
(x) => TwentyEight$inboundSchema.parse(JSON.parse(x)),
|
|
496
|
+
`Failed to parse 'TwentyEight' from JSON`,
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/** @internal */
|
|
501
|
+
export const TwentySeven$inboundSchema: z.ZodType<
|
|
502
|
+
TwentySeven,
|
|
503
|
+
z.ZodTypeDef,
|
|
504
|
+
unknown
|
|
505
|
+
> = z.object({
|
|
506
|
+
type: z.literal("flesch_reading_ease"),
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
export function twentySevenFromJSON(
|
|
510
|
+
jsonString: string,
|
|
511
|
+
): SafeParseResult<TwentySeven, SDKValidationError> {
|
|
512
|
+
return safeParse(
|
|
513
|
+
jsonString,
|
|
514
|
+
(x) => TwentySeven$inboundSchema.parse(JSON.parse(x)),
|
|
515
|
+
`Failed to parse 'TwentySeven' from JSON`,
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/** @internal */
|
|
520
|
+
export const TwentySix$inboundSchema: z.ZodType<
|
|
521
|
+
TwentySix,
|
|
522
|
+
z.ZodTypeDef,
|
|
523
|
+
unknown
|
|
524
|
+
> = z.object({
|
|
525
|
+
type: z.literal("most_repeated_words"),
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
export function twentySixFromJSON(
|
|
529
|
+
jsonString: string,
|
|
530
|
+
): SafeParseResult<TwentySix, SDKValidationError> {
|
|
531
|
+
return safeParse(
|
|
532
|
+
jsonString,
|
|
533
|
+
(x) => TwentySix$inboundSchema.parse(JSON.parse(x)),
|
|
534
|
+
`Failed to parse 'TwentySix' from JSON`,
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/** @internal */
|
|
539
|
+
export const TwentyFive$inboundSchema: z.ZodType<
|
|
540
|
+
TwentyFive,
|
|
541
|
+
z.ZodTypeDef,
|
|
542
|
+
unknown
|
|
543
|
+
> = z.object({
|
|
544
|
+
type: z.literal("keywords_match"),
|
|
545
|
+
keywords: z.array(z.string()),
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
export function twentyFiveFromJSON(
|
|
549
|
+
jsonString: string,
|
|
550
|
+
): SafeParseResult<TwentyFive, SDKValidationError> {
|
|
551
|
+
return safeParse(
|
|
552
|
+
jsonString,
|
|
553
|
+
(x) => TwentyFive$inboundSchema.parse(JSON.parse(x)),
|
|
554
|
+
`Failed to parse 'TwentyFive' from JSON`,
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/** @internal */
|
|
559
|
+
export const TwentyFour$inboundSchema: z.ZodType<
|
|
560
|
+
TwentyFour,
|
|
561
|
+
z.ZodTypeDef,
|
|
562
|
+
unknown
|
|
563
|
+
> = z.object({
|
|
564
|
+
type: z.literal("levenshtein_distance"),
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
export function twentyFourFromJSON(
|
|
568
|
+
jsonString: string,
|
|
569
|
+
): SafeParseResult<TwentyFour, SDKValidationError> {
|
|
570
|
+
return safeParse(
|
|
571
|
+
jsonString,
|
|
572
|
+
(x) => TwentyFour$inboundSchema.parse(JSON.parse(x)),
|
|
573
|
+
`Failed to parse 'TwentyFour' from JSON`,
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/** @internal */
|
|
578
|
+
export const TwentyThree$inboundSchema: z.ZodType<
|
|
579
|
+
TwentyThree,
|
|
580
|
+
z.ZodTypeDef,
|
|
581
|
+
unknown
|
|
582
|
+
> = z.object({
|
|
583
|
+
type: z.literal("cosine_similarity"),
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
export function twentyThreeFromJSON(
|
|
587
|
+
jsonString: string,
|
|
588
|
+
): SafeParseResult<TwentyThree, SDKValidationError> {
|
|
589
|
+
return safeParse(
|
|
590
|
+
jsonString,
|
|
591
|
+
(x) => TwentyThree$inboundSchema.parse(JSON.parse(x)),
|
|
592
|
+
`Failed to parse 'TwentyThree' from JSON`,
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/** @internal */
|
|
597
|
+
export const TwentyTwo$inboundSchema: z.ZodType<
|
|
598
|
+
TwentyTwo,
|
|
599
|
+
z.ZodTypeDef,
|
|
600
|
+
unknown
|
|
601
|
+
> = z.object({
|
|
602
|
+
type: z.literal("meteor_score"),
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
export function twentyTwoFromJSON(
|
|
606
|
+
jsonString: string,
|
|
607
|
+
): SafeParseResult<TwentyTwo, SDKValidationError> {
|
|
608
|
+
return safeParse(
|
|
609
|
+
jsonString,
|
|
610
|
+
(x) => TwentyTwo$inboundSchema.parse(JSON.parse(x)),
|
|
611
|
+
`Failed to parse 'TwentyTwo' from JSON`,
|
|
612
|
+
);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/** @internal */
|
|
616
|
+
export const TwentyOne$inboundSchema: z.ZodType<
|
|
617
|
+
TwentyOne,
|
|
618
|
+
z.ZodTypeDef,
|
|
619
|
+
unknown
|
|
620
|
+
> = z.object({
|
|
621
|
+
type: z.literal("rouge_n"),
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
export function twentyOneFromJSON(
|
|
625
|
+
jsonString: string,
|
|
626
|
+
): SafeParseResult<TwentyOne, SDKValidationError> {
|
|
627
|
+
return safeParse(
|
|
628
|
+
jsonString,
|
|
629
|
+
(x) => TwentyOne$inboundSchema.parse(JSON.parse(x)),
|
|
630
|
+
`Failed to parse 'TwentyOne' from JSON`,
|
|
631
|
+
);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/** @internal */
|
|
635
|
+
export const Twenty$inboundSchema: z.ZodType<Twenty, z.ZodTypeDef, unknown> = z
|
|
636
|
+
.object({
|
|
637
|
+
type: z.literal("bleu_score"),
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
export function twentyFromJSON(
|
|
641
|
+
jsonString: string,
|
|
642
|
+
): SafeParseResult<Twenty, SDKValidationError> {
|
|
643
|
+
return safeParse(
|
|
644
|
+
jsonString,
|
|
645
|
+
(x) => Twenty$inboundSchema.parse(JSON.parse(x)),
|
|
646
|
+
`Failed to parse 'Twenty' from JSON`,
|
|
647
|
+
);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/** @internal */
|
|
651
|
+
export const Nineteen$inboundSchema: z.ZodType<
|
|
652
|
+
Nineteen,
|
|
653
|
+
z.ZodTypeDef,
|
|
654
|
+
unknown
|
|
655
|
+
> = z.object({
|
|
656
|
+
type: z.literal("bert_score"),
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
export function nineteenFromJSON(
|
|
660
|
+
jsonString: string,
|
|
661
|
+
): SafeParseResult<Nineteen, SDKValidationError> {
|
|
662
|
+
return safeParse(
|
|
663
|
+
jsonString,
|
|
664
|
+
(x) => Nineteen$inboundSchema.parse(JSON.parse(x)),
|
|
665
|
+
`Failed to parse 'Nineteen' from JSON`,
|
|
666
|
+
);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/** @internal */
|
|
670
|
+
export const Eighteen$inboundSchema: z.ZodType<
|
|
671
|
+
Eighteen,
|
|
672
|
+
z.ZodTypeDef,
|
|
673
|
+
unknown
|
|
674
|
+
> = z.object({
|
|
675
|
+
type: z.literal("moderations_google"),
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
export function eighteenFromJSON(
|
|
679
|
+
jsonString: string,
|
|
680
|
+
): SafeParseResult<Eighteen, SDKValidationError> {
|
|
681
|
+
return safeParse(
|
|
682
|
+
jsonString,
|
|
683
|
+
(x) => Eighteen$inboundSchema.parse(JSON.parse(x)),
|
|
684
|
+
`Failed to parse 'Eighteen' from JSON`,
|
|
685
|
+
);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/** @internal */
|
|
689
|
+
export const Seventeen$inboundSchema: z.ZodType<
|
|
690
|
+
Seventeen,
|
|
691
|
+
z.ZodTypeDef,
|
|
692
|
+
unknown
|
|
693
|
+
> = z.object({
|
|
694
|
+
type: z.literal("moderations_openai"),
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
export function seventeenFromJSON(
|
|
698
|
+
jsonString: string,
|
|
699
|
+
): SafeParseResult<Seventeen, SDKValidationError> {
|
|
700
|
+
return safeParse(
|
|
701
|
+
jsonString,
|
|
702
|
+
(x) => Seventeen$inboundSchema.parse(JSON.parse(x)),
|
|
703
|
+
`Failed to parse 'Seventeen' from JSON`,
|
|
704
|
+
);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/** @internal */
|
|
708
|
+
export const Sixteen$inboundSchema: z.ZodType<Sixteen, z.ZodTypeDef, unknown> =
|
|
709
|
+
z.object({
|
|
710
|
+
type: z.literal("is_valid_json"),
|
|
711
|
+
});
|
|
712
|
+
|
|
713
|
+
export function sixteenFromJSON(
|
|
714
|
+
jsonString: string,
|
|
715
|
+
): SafeParseResult<Sixteen, SDKValidationError> {
|
|
716
|
+
return safeParse(
|
|
717
|
+
jsonString,
|
|
718
|
+
(x) => Sixteen$inboundSchema.parse(JSON.parse(x)),
|
|
719
|
+
`Failed to parse 'Sixteen' from JSON`,
|
|
720
|
+
);
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/** @internal */
|
|
724
|
+
export const Fifteen$inboundSchema: z.ZodType<Fifteen, z.ZodTypeDef, unknown> =
|
|
725
|
+
z.object({
|
|
726
|
+
type: z.literal("regex"),
|
|
727
|
+
pattern: z.string(),
|
|
728
|
+
});
|
|
729
|
+
|
|
730
|
+
export function fifteenFromJSON(
|
|
731
|
+
jsonString: string,
|
|
732
|
+
): SafeParseResult<Fifteen, SDKValidationError> {
|
|
733
|
+
return safeParse(
|
|
734
|
+
jsonString,
|
|
735
|
+
(x) => Fifteen$inboundSchema.parse(JSON.parse(x)),
|
|
736
|
+
`Failed to parse 'Fifteen' from JSON`,
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/** @internal */
|
|
741
|
+
export const Fourteen$inboundSchema: z.ZodType<
|
|
742
|
+
Fourteen,
|
|
743
|
+
z.ZodTypeDef,
|
|
744
|
+
unknown
|
|
745
|
+
> = z.object({
|
|
746
|
+
type: z.literal("one_line"),
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
export function fourteenFromJSON(
|
|
750
|
+
jsonString: string,
|
|
751
|
+
): SafeParseResult<Fourteen, SDKValidationError> {
|
|
752
|
+
return safeParse(
|
|
753
|
+
jsonString,
|
|
754
|
+
(x) => Fourteen$inboundSchema.parse(JSON.parse(x)),
|
|
755
|
+
`Failed to parse 'Fourteen' from JSON`,
|
|
756
|
+
);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/** @internal */
|
|
760
|
+
export const Thirteen$inboundSchema: z.ZodType<
|
|
761
|
+
Thirteen,
|
|
762
|
+
z.ZodTypeDef,
|
|
763
|
+
unknown
|
|
764
|
+
> = z.object({
|
|
765
|
+
type: z.literal("length_greater_than"),
|
|
766
|
+
value: z.number(),
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
export function thirteenFromJSON(
|
|
770
|
+
jsonString: string,
|
|
771
|
+
): SafeParseResult<Thirteen, SDKValidationError> {
|
|
772
|
+
return safeParse(
|
|
773
|
+
jsonString,
|
|
774
|
+
(x) => Thirteen$inboundSchema.parse(JSON.parse(x)),
|
|
775
|
+
`Failed to parse 'Thirteen' from JSON`,
|
|
776
|
+
);
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/** @internal */
|
|
780
|
+
export const Twelve$inboundSchema: z.ZodType<Twelve, z.ZodTypeDef, unknown> = z
|
|
781
|
+
.object({
|
|
782
|
+
type: z.literal("length_between"),
|
|
783
|
+
min: z.number(),
|
|
784
|
+
max: z.number(),
|
|
785
|
+
});
|
|
786
|
+
|
|
787
|
+
export function twelveFromJSON(
|
|
788
|
+
jsonString: string,
|
|
789
|
+
): SafeParseResult<Twelve, SDKValidationError> {
|
|
790
|
+
return safeParse(
|
|
791
|
+
jsonString,
|
|
792
|
+
(x) => Twelve$inboundSchema.parse(JSON.parse(x)),
|
|
793
|
+
`Failed to parse 'Twelve' from JSON`,
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/** @internal */
|
|
798
|
+
export const Eleven$inboundSchema: z.ZodType<Eleven, z.ZodTypeDef, unknown> = z
|
|
799
|
+
.object({
|
|
800
|
+
type: z.literal("length_less_than"),
|
|
801
|
+
value: z.number(),
|
|
802
|
+
});
|
|
803
|
+
|
|
804
|
+
export function elevenFromJSON(
|
|
805
|
+
jsonString: string,
|
|
806
|
+
): SafeParseResult<Eleven, SDKValidationError> {
|
|
807
|
+
return safeParse(
|
|
808
|
+
jsonString,
|
|
809
|
+
(x) => Eleven$inboundSchema.parse(JSON.parse(x)),
|
|
810
|
+
`Failed to parse 'Eleven' from JSON`,
|
|
811
|
+
);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/** @internal */
|
|
815
|
+
export const Ten$inboundSchema: z.ZodType<Ten, z.ZodTypeDef, unknown> = z
|
|
816
|
+
.object({
|
|
817
|
+
type: z.literal("exact_match"),
|
|
818
|
+
});
|
|
819
|
+
|
|
820
|
+
export function tenFromJSON(
|
|
821
|
+
jsonString: string,
|
|
822
|
+
): SafeParseResult<Ten, SDKValidationError> {
|
|
823
|
+
return safeParse(
|
|
824
|
+
jsonString,
|
|
825
|
+
(x) => Ten$inboundSchema.parse(JSON.parse(x)),
|
|
826
|
+
`Failed to parse 'Ten' from JSON`,
|
|
827
|
+
);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
/** @internal */
|
|
831
|
+
export const Nine$inboundSchema: z.ZodType<Nine, z.ZodTypeDef, unknown> = z
|
|
832
|
+
.object({
|
|
833
|
+
type: z.literal("ends_with"),
|
|
834
|
+
value: z.string(),
|
|
835
|
+
});
|
|
836
|
+
|
|
837
|
+
export function nineFromJSON(
|
|
838
|
+
jsonString: string,
|
|
839
|
+
): SafeParseResult<Nine, SDKValidationError> {
|
|
840
|
+
return safeParse(
|
|
841
|
+
jsonString,
|
|
842
|
+
(x) => Nine$inboundSchema.parse(JSON.parse(x)),
|
|
843
|
+
`Failed to parse 'Nine' from JSON`,
|
|
844
|
+
);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/** @internal */
|
|
848
|
+
export const Eight$inboundSchema: z.ZodType<Eight, z.ZodTypeDef, unknown> = z
|
|
849
|
+
.object({
|
|
850
|
+
type: z.literal("start_with"),
|
|
851
|
+
value: z.string(),
|
|
852
|
+
});
|
|
853
|
+
|
|
854
|
+
export function eightFromJSON(
|
|
855
|
+
jsonString: string,
|
|
856
|
+
): SafeParseResult<Eight, SDKValidationError> {
|
|
857
|
+
return safeParse(
|
|
858
|
+
jsonString,
|
|
859
|
+
(x) => Eight$inboundSchema.parse(JSON.parse(x)),
|
|
860
|
+
`Failed to parse 'Eight' from JSON`,
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
/** @internal */
|
|
865
|
+
export const Seven$inboundSchema: z.ZodType<Seven, z.ZodTypeDef, unknown> = z
|
|
866
|
+
.object({
|
|
867
|
+
type: z.literal("contains_valid_link"),
|
|
868
|
+
});
|
|
869
|
+
|
|
870
|
+
export function sevenFromJSON(
|
|
871
|
+
jsonString: string,
|
|
872
|
+
): SafeParseResult<Seven, SDKValidationError> {
|
|
873
|
+
return safeParse(
|
|
874
|
+
jsonString,
|
|
875
|
+
(x) => Seven$inboundSchema.parse(JSON.parse(x)),
|
|
876
|
+
`Failed to parse 'Seven' from JSON`,
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/** @internal */
|
|
881
|
+
export const Six$inboundSchema: z.ZodType<Six, z.ZodTypeDef, unknown> = z
|
|
882
|
+
.object({
|
|
883
|
+
type: z.literal("contains_url"),
|
|
884
|
+
});
|
|
885
|
+
|
|
886
|
+
export function sixFromJSON(
|
|
887
|
+
jsonString: string,
|
|
888
|
+
): SafeParseResult<Six, SDKValidationError> {
|
|
889
|
+
return safeParse(
|
|
890
|
+
jsonString,
|
|
891
|
+
(x) => Six$inboundSchema.parse(JSON.parse(x)),
|
|
892
|
+
`Failed to parse 'Six' from JSON`,
|
|
893
|
+
);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/** @internal */
|
|
897
|
+
export const Five$inboundSchema: z.ZodType<Five, z.ZodTypeDef, unknown> = z
|
|
898
|
+
.object({
|
|
899
|
+
type: z.literal("contains_email"),
|
|
900
|
+
});
|
|
901
|
+
|
|
902
|
+
export function fiveFromJSON(
|
|
903
|
+
jsonString: string,
|
|
904
|
+
): SafeParseResult<Five, SDKValidationError> {
|
|
905
|
+
return safeParse(
|
|
906
|
+
jsonString,
|
|
907
|
+
(x) => Five$inboundSchema.parse(JSON.parse(x)),
|
|
908
|
+
`Failed to parse 'Five' from JSON`,
|
|
909
|
+
);
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
/** @internal */
|
|
913
|
+
export const Four$inboundSchema: z.ZodType<Four, z.ZodTypeDef, unknown> = z
|
|
914
|
+
.object({
|
|
915
|
+
type: z.literal("contains_any"),
|
|
916
|
+
keywords: z.array(z.string()),
|
|
917
|
+
});
|
|
918
|
+
|
|
919
|
+
export function fourFromJSON(
|
|
920
|
+
jsonString: string,
|
|
921
|
+
): SafeParseResult<Four, SDKValidationError> {
|
|
922
|
+
return safeParse(
|
|
923
|
+
jsonString,
|
|
924
|
+
(x) => Four$inboundSchema.parse(JSON.parse(x)),
|
|
925
|
+
`Failed to parse 'Four' from JSON`,
|
|
926
|
+
);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/** @internal */
|
|
930
|
+
export const Three$inboundSchema: z.ZodType<Three, z.ZodTypeDef, unknown> = z
|
|
931
|
+
.object({
|
|
932
|
+
type: z.literal("contains_all"),
|
|
933
|
+
keywords: z.array(z.string()),
|
|
934
|
+
});
|
|
935
|
+
|
|
936
|
+
export function threeFromJSON(
|
|
937
|
+
jsonString: string,
|
|
938
|
+
): SafeParseResult<Three, SDKValidationError> {
|
|
939
|
+
return safeParse(
|
|
940
|
+
jsonString,
|
|
941
|
+
(x) => Three$inboundSchema.parse(JSON.parse(x)),
|
|
942
|
+
`Failed to parse 'Three' from JSON`,
|
|
943
|
+
);
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
/** @internal */
|
|
947
|
+
export const Two$inboundSchema: z.ZodType<Two, z.ZodTypeDef, unknown> = z
|
|
948
|
+
.object({
|
|
949
|
+
type: z.literal("contains_none"),
|
|
950
|
+
keywords: z.array(z.string()),
|
|
951
|
+
});
|
|
952
|
+
|
|
953
|
+
export function twoFromJSON(
|
|
954
|
+
jsonString: string,
|
|
955
|
+
): SafeParseResult<Two, SDKValidationError> {
|
|
956
|
+
return safeParse(
|
|
957
|
+
jsonString,
|
|
958
|
+
(x) => Two$inboundSchema.parse(JSON.parse(x)),
|
|
959
|
+
`Failed to parse 'Two' from JSON`,
|
|
960
|
+
);
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
/** @internal */
|
|
964
|
+
export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
|
|
965
|
+
.object({
|
|
966
|
+
type: z.literal("contains"),
|
|
967
|
+
value: z.string(),
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
export function oneFromJSON(
|
|
971
|
+
jsonString: string,
|
|
972
|
+
): SafeParseResult<One, SDKValidationError> {
|
|
973
|
+
return safeParse(
|
|
974
|
+
jsonString,
|
|
975
|
+
(x) => One$inboundSchema.parse(JSON.parse(x)),
|
|
976
|
+
`Failed to parse 'One' from JSON`,
|
|
977
|
+
);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
/** @internal */
|
|
981
|
+
export const FunctionParams$inboundSchema: z.ZodType<
|
|
982
|
+
FunctionParams,
|
|
983
|
+
z.ZodTypeDef,
|
|
984
|
+
unknown
|
|
985
|
+
> = z.union([
|
|
986
|
+
z.lazy(() => One$inboundSchema),
|
|
987
|
+
z.lazy(() => Two$inboundSchema),
|
|
988
|
+
z.lazy(() => Three$inboundSchema),
|
|
989
|
+
z.lazy(() => Four$inboundSchema),
|
|
990
|
+
z.lazy(() => Five$inboundSchema),
|
|
991
|
+
z.lazy(() => Six$inboundSchema),
|
|
992
|
+
z.lazy(() => Seven$inboundSchema),
|
|
993
|
+
z.lazy(() => Eight$inboundSchema),
|
|
994
|
+
z.lazy(() => Nine$inboundSchema),
|
|
995
|
+
z.lazy(() => Ten$inboundSchema),
|
|
996
|
+
z.lazy(() => Eleven$inboundSchema),
|
|
997
|
+
z.lazy(() => Twelve$inboundSchema),
|
|
998
|
+
z.lazy(() => Thirteen$inboundSchema),
|
|
999
|
+
z.lazy(() => Fourteen$inboundSchema),
|
|
1000
|
+
z.lazy(() => Fifteen$inboundSchema),
|
|
1001
|
+
z.lazy(() => Sixteen$inboundSchema),
|
|
1002
|
+
z.lazy(() => Seventeen$inboundSchema),
|
|
1003
|
+
z.lazy(() => Eighteen$inboundSchema),
|
|
1004
|
+
z.lazy(() => Nineteen$inboundSchema),
|
|
1005
|
+
z.lazy(() => Twenty$inboundSchema),
|
|
1006
|
+
z.lazy(() => TwentyOne$inboundSchema),
|
|
1007
|
+
z.lazy(() => TwentyTwo$inboundSchema),
|
|
1008
|
+
z.lazy(() => TwentyThree$inboundSchema),
|
|
1009
|
+
z.lazy(() => TwentyFour$inboundSchema),
|
|
1010
|
+
z.lazy(() => TwentyFive$inboundSchema),
|
|
1011
|
+
z.lazy(() => TwentySix$inboundSchema),
|
|
1012
|
+
z.lazy(() => TwentySeven$inboundSchema),
|
|
1013
|
+
z.lazy(() => TwentyEight$inboundSchema),
|
|
1014
|
+
z.lazy(() => TwentyNine$inboundSchema),
|
|
1015
|
+
z.lazy(() => Thirty$inboundSchema),
|
|
1016
|
+
z.lazy(() => ThirtyOne$inboundSchema),
|
|
1017
|
+
z.lazy(() => ThirtyTwo$inboundSchema),
|
|
1018
|
+
]);
|
|
1019
|
+
|
|
1020
|
+
export function functionParamsFromJSON(
|
|
1021
|
+
jsonString: string,
|
|
1022
|
+
): SafeParseResult<FunctionParams, SDKValidationError> {
|
|
1023
|
+
return safeParse(
|
|
1024
|
+
jsonString,
|
|
1025
|
+
(x) => FunctionParams$inboundSchema.parse(JSON.parse(x)),
|
|
1026
|
+
`Failed to parse 'FunctionParams' from JSON`,
|
|
1027
|
+
);
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/** @internal */
|
|
1031
|
+
export const EvaluatorResponseFunction$inboundSchema: z.ZodType<
|
|
1032
|
+
EvaluatorResponseFunction,
|
|
1033
|
+
z.ZodTypeDef,
|
|
1034
|
+
unknown
|
|
1035
|
+
> = z.object({
|
|
1036
|
+
_id: z.string(),
|
|
1037
|
+
description: z.string(),
|
|
1038
|
+
created: z.string().default("2026-06-29T09:12:37.464Z"),
|
|
1039
|
+
updated: z.string().default("2026-06-29T09:12:37.464Z"),
|
|
1040
|
+
updated_by_id: z.nullable(z.string()).optional(),
|
|
1041
|
+
guardrail_config: z.nullable(
|
|
1042
|
+
z.union([
|
|
1043
|
+
z.lazy(() =>
|
|
1044
|
+
EvaluatorResponseFunctionGuardrailConfigBoolean$inboundSchema
|
|
1045
|
+
),
|
|
1046
|
+
z.lazy(() =>
|
|
1047
|
+
EvaluatorResponseFunctionGuardrailConfigCategorical$inboundSchema
|
|
1048
|
+
),
|
|
1049
|
+
z.lazy(() =>
|
|
1050
|
+
EvaluatorResponseFunctionGuardrailConfigNumber$inboundSchema
|
|
1051
|
+
),
|
|
1052
|
+
]),
|
|
1053
|
+
).optional(),
|
|
1054
|
+
type: z.literal("function_eval"),
|
|
1055
|
+
function_params: z.union([
|
|
1056
|
+
z.lazy(() => One$inboundSchema),
|
|
1057
|
+
z.lazy(() => Two$inboundSchema),
|
|
1058
|
+
z.lazy(() => Three$inboundSchema),
|
|
1059
|
+
z.lazy(() => Four$inboundSchema),
|
|
1060
|
+
z.lazy(() => Five$inboundSchema),
|
|
1061
|
+
z.lazy(() => Six$inboundSchema),
|
|
1062
|
+
z.lazy(() => Seven$inboundSchema),
|
|
1063
|
+
z.lazy(() => Eight$inboundSchema),
|
|
1064
|
+
z.lazy(() => Nine$inboundSchema),
|
|
1065
|
+
z.lazy(() => Ten$inboundSchema),
|
|
1066
|
+
z.lazy(() => Eleven$inboundSchema),
|
|
1067
|
+
z.lazy(() => Twelve$inboundSchema),
|
|
1068
|
+
z.lazy(() => Thirteen$inboundSchema),
|
|
1069
|
+
z.lazy(() => Fourteen$inboundSchema),
|
|
1070
|
+
z.lazy(() => Fifteen$inboundSchema),
|
|
1071
|
+
z.lazy(() => Sixteen$inboundSchema),
|
|
1072
|
+
z.lazy(() => Seventeen$inboundSchema),
|
|
1073
|
+
z.lazy(() => Eighteen$inboundSchema),
|
|
1074
|
+
z.lazy(() => Nineteen$inboundSchema),
|
|
1075
|
+
z.lazy(() => Twenty$inboundSchema),
|
|
1076
|
+
z.lazy(() => TwentyOne$inboundSchema),
|
|
1077
|
+
z.lazy(() => TwentyTwo$inboundSchema),
|
|
1078
|
+
z.lazy(() => TwentyThree$inboundSchema),
|
|
1079
|
+
z.lazy(() => TwentyFour$inboundSchema),
|
|
1080
|
+
z.lazy(() => TwentyFive$inboundSchema),
|
|
1081
|
+
z.lazy(() => TwentySix$inboundSchema),
|
|
1082
|
+
z.lazy(() => TwentySeven$inboundSchema),
|
|
1083
|
+
z.lazy(() => TwentyEight$inboundSchema),
|
|
1084
|
+
z.lazy(() => TwentyNine$inboundSchema),
|
|
1085
|
+
z.lazy(() => Thirty$inboundSchema),
|
|
1086
|
+
z.lazy(() => ThirtyOne$inboundSchema),
|
|
1087
|
+
z.lazy(() => ThirtyTwo$inboundSchema),
|
|
1088
|
+
]),
|
|
1089
|
+
key: z.string(),
|
|
1090
|
+
}).transform((v) => {
|
|
1091
|
+
return remap$(v, {
|
|
1092
|
+
"_id": "id",
|
|
1093
|
+
"updated_by_id": "updatedById",
|
|
1094
|
+
"guardrail_config": "guardrailConfig",
|
|
1095
|
+
"function_params": "functionParams",
|
|
1096
|
+
});
|
|
1097
|
+
});
|
|
1098
|
+
|
|
1099
|
+
export function evaluatorResponseFunctionFromJSON(
|
|
1100
|
+
jsonString: string,
|
|
1101
|
+
): SafeParseResult<EvaluatorResponseFunction, SDKValidationError> {
|
|
1102
|
+
return safeParse(
|
|
1103
|
+
jsonString,
|
|
1104
|
+
(x) => EvaluatorResponseFunction$inboundSchema.parse(JSON.parse(x)),
|
|
1105
|
+
`Failed to parse 'EvaluatorResponseFunction' from JSON`,
|
|
1106
|
+
);
|
|
1107
|
+
}
|