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