@orq-ai/node 4.7.3 → 4.7.6
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/README.md +1 -1
- package/funcs/filesCreate.js +3 -2
- package/funcs/filesCreate.js.map +1 -1
- package/funcs/filesGetContent.d.ts +1 -1
- package/funcs/filesGetContent.js +3 -3
- package/funcs/filesGetContent.js.map +1 -1
- package/funcs/routerAudioTranscriptionsCreate.js +3 -2
- package/funcs/routerAudioTranscriptionsCreate.js.map +1 -1
- package/funcs/routerAudioTranslationsCreate.js +3 -2
- package/funcs/routerAudioTranslationsCreate.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/encodings.d.ts +1 -0
- package/lib/encodings.d.ts.map +1 -1
- package/lib/encodings.js +7 -0
- package/lib/encodings.js.map +1 -1
- package/models/components/reasoningpart.js +1 -1
- package/models/operations/createcontact.js +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.js +16 -16
- package/models/operations/createidentity.js +1 -1
- package/models/operations/createtool.js +6 -6
- package/models/operations/filecontent.d.ts +3 -3
- package/models/operations/filecontent.d.ts.map +1 -1
- package/models/operations/filecontent.js +2 -2
- package/models/operations/filecontent.js.map +1 -1
- package/models/operations/getalltools.js +6 -6
- package/models/operations/getevals.js +16 -16
- package/models/operations/getv2humanevals.js +6 -6
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/getv2humanevalsid.js +6 -6
- package/models/operations/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/listidentities.js +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/patchv2humanevalsid.js +12 -12
- package/models/operations/postv2feedbackevaluation.js +3 -3
- package/models/operations/postv2humanevals.js +12 -12
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrievedatapoint.js +4 -4
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievedatasource.js +1 -1
- package/models/operations/retrieveidentity.js +1 -1
- package/models/operations/retrievetool.js +6 -6
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +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.js +16 -16
- package/models/operations/updateidentity.js +1 -1
- package/models/operations/updatetool.js +7 -7
- package/package.json +1 -1
- package/packages/orq-rc/src/funcs/agentsCreate.ts +2 -2
- package/packages/orq-rc/src/funcs/filesCreate.ts +4 -3
- package/packages/orq-rc/src/funcs/guardrailRulesCreate.ts +161 -0
- package/packages/orq-rc/src/funcs/guardrailRulesDelete.ts +170 -0
- package/packages/orq-rc/src/funcs/guardrailRulesGet.ts +168 -0
- package/packages/orq-rc/src/funcs/guardrailRulesList.ts +170 -0
- package/packages/orq-rc/src/funcs/guardrailRulesUpdate.ts +170 -0
- package/packages/orq-rc/src/funcs/policiesCreate.ts +160 -0
- package/packages/orq-rc/src/funcs/policiesDelete.ts +166 -0
- package/packages/orq-rc/src/funcs/policiesGet.ts +165 -0
- package/packages/orq-rc/src/funcs/policiesList.ts +168 -0
- package/packages/orq-rc/src/funcs/policiesUpdate.ts +166 -0
- package/packages/orq-rc/src/funcs/routerAudioTranscriptionsCreate.ts +4 -3
- package/packages/orq-rc/src/funcs/routerAudioTranslationsCreate.ts +4 -3
- package/packages/orq-rc/src/funcs/routingRulesCreate.ts +161 -0
- package/packages/orq-rc/src/funcs/routingRulesDelete.ts +166 -0
- package/packages/orq-rc/src/funcs/routingRulesGet.ts +165 -0
- package/packages/orq-rc/src/funcs/routingRulesList.ts +168 -0
- package/packages/orq-rc/src/funcs/routingRulesUpdate.ts +166 -0
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/lib/encodings.ts +9 -0
- package/packages/orq-rc/src/models/components/agentstartedstreamingevent.ts +9 -6
- package/packages/orq-rc/src/models/components/budgetlimit.ts +83 -0
- package/packages/orq-rc/src/models/components/evaluatorref.ts +89 -0
- package/packages/orq-rc/src/models/components/expression.ts +51 -0
- package/packages/orq-rc/src/models/components/guardrailref.ts +75 -0
- package/packages/orq-rc/src/models/components/guardrailruledocument.ts +66 -0
- package/packages/orq-rc/src/models/components/index.ts +13 -0
- package/packages/orq-rc/src/models/components/limits.ts +70 -0
- package/packages/orq-rc/src/models/components/modelref.ts +64 -0
- package/packages/orq-rc/src/models/components/modelsconfig.ts +73 -0
- package/packages/orq-rc/src/models/components/policydocument.ts +76 -0
- package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
- package/packages/orq-rc/src/models/components/requestlimit.ts +69 -0
- package/packages/orq-rc/src/models/components/retryconfig.ts +60 -0
- package/packages/orq-rc/src/models/components/routingruledocument.ts +67 -0
- package/packages/orq-rc/src/models/components/tokenlimit.ts +69 -0
- package/packages/orq-rc/src/models/operations/createagentrequest.ts +0 -3
- package/packages/orq-rc/src/models/operations/createcontact.ts +1 -1
- package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
- package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/createeval.ts +958 -132
- package/packages/orq-rc/src/models/operations/createidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/createtool.ts +6 -21
- package/packages/orq-rc/src/models/operations/getalltools.ts +6 -21
- package/packages/orq-rc/src/models/operations/getevals.ts +447 -16
- package/packages/orq-rc/src/models/operations/getv2humanevals.ts +6 -6
- package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
- package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/packages/orq-rc/src/models/operations/getv2humanevalsid.ts +6 -6
- package/packages/orq-rc/src/models/operations/guardrailrulecreate.ts +124 -0
- package/packages/orq-rc/src/models/operations/guardrailruledelete.ts +39 -0
- package/packages/orq-rc/src/models/operations/guardrailruleget.ts +102 -0
- package/packages/orq-rc/src/models/operations/guardrailrulelist.ts +94 -0
- package/packages/orq-rc/src/models/operations/guardrailruleupdate.ts +153 -0
- package/packages/orq-rc/src/models/operations/index.ts +15 -0
- package/packages/orq-rc/src/models/operations/listagents.ts +0 -3
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
- package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
- package/packages/orq-rc/src/models/operations/listidentities.ts +1 -1
- package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/packages/orq-rc/src/models/operations/patchv2humanevalsid.ts +12 -12
- package/packages/orq-rc/src/models/operations/policycreate.ts +138 -0
- package/packages/orq-rc/src/models/operations/policydelete.ts +39 -0
- package/packages/orq-rc/src/models/operations/policyget.ts +110 -0
- package/packages/orq-rc/src/models/operations/policylist.ts +94 -0
- package/packages/orq-rc/src/models/operations/policyupdate.ts +167 -0
- package/packages/orq-rc/src/models/operations/postv2agentsa2a.ts +0 -3
- package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +3 -3
- package/packages/orq-rc/src/models/operations/postv2humanevals.ts +12 -12
- package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +0 -3
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrieveidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -21
- package/packages/orq-rc/src/models/operations/routingrulecreate.ts +124 -0
- package/packages/orq-rc/src/models/operations/routingruledelete.ts +39 -0
- package/packages/orq-rc/src/models/operations/routingruleget.ts +102 -0
- package/packages/orq-rc/src/models/operations/routingrulelist.ts +94 -0
- package/packages/orq-rc/src/models/operations/routingruleupdate.ts +154 -0
- package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/updateagent.ts +0 -3
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
- package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/updateeval.ts +646 -16
- package/packages/orq-rc/src/models/operations/updateidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatetool.ts +7 -22
- package/packages/orq-rc/src/sdk/guardrailrules.ts +99 -0
- package/packages/orq-rc/src/sdk/policies.ts +99 -0
- package/packages/orq-rc/src/sdk/routingrules.ts +99 -0
- package/packages/orq-rc/src/sdk/sdk.ts +18 -0
- package/sdk/files.d.ts +7 -7
- package/sdk/files.d.ts.map +1 -1
- package/sdk/files.js +9 -9
- package/sdk/files.js.map +1 -1
- package/src/funcs/filesCreate.ts +4 -3
- package/src/funcs/filesGetContent.ts +3 -3
- package/src/funcs/routerAudioTranscriptionsCreate.ts +4 -3
- package/src/funcs/routerAudioTranslationsCreate.ts +4 -3
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +9 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/operations/createcontact.ts +1 -1
- 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 +16 -16
- package/src/models/operations/createidentity.ts +1 -1
- package/src/models/operations/createtool.ts +6 -6
- package/src/models/operations/filecontent.ts +5 -5
- package/src/models/operations/getalltools.ts +6 -6
- package/src/models/operations/getevals.ts +16 -16
- package/src/models/operations/getv2humanevals.ts +6 -6
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/getv2humanevalsid.ts +6 -6
- 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/listidentities.ts +1 -1
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/patchv2humanevalsid.ts +12 -12
- package/src/models/operations/postv2feedbackevaluation.ts +3 -3
- package/src/models/operations/postv2humanevals.ts +12 -12
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- 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/retrieveidentity.ts +1 -1
- package/src/models/operations/retrievetool.ts +6 -6
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- 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 +16 -16
- package/src/models/operations/updateidentity.ts +1 -1
- package/src/models/operations/updatetool.ts +7 -7
- package/src/sdk/files.ts +17 -17
|
@@ -0,0 +1,75 @@
|
|
|
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 ExecuteOn = {
|
|
13
|
+
Input: "input",
|
|
14
|
+
Output: "output",
|
|
15
|
+
Both: "both",
|
|
16
|
+
} as const;
|
|
17
|
+
export type ExecuteOn = ClosedEnum<typeof ExecuteOn>;
|
|
18
|
+
|
|
19
|
+
export type GuardrailRef = {
|
|
20
|
+
executeOn: ExecuteOn;
|
|
21
|
+
id: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const ExecuteOn$inboundSchema: z.ZodNativeEnum<typeof ExecuteOn> = z
|
|
26
|
+
.nativeEnum(ExecuteOn);
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const ExecuteOn$outboundSchema: z.ZodNativeEnum<typeof ExecuteOn> =
|
|
29
|
+
ExecuteOn$inboundSchema;
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const GuardrailRef$inboundSchema: z.ZodType<
|
|
33
|
+
GuardrailRef,
|
|
34
|
+
z.ZodTypeDef,
|
|
35
|
+
unknown
|
|
36
|
+
> = z.object({
|
|
37
|
+
execute_on: ExecuteOn$inboundSchema,
|
|
38
|
+
id: z.string(),
|
|
39
|
+
}).transform((v) => {
|
|
40
|
+
return remap$(v, {
|
|
41
|
+
"execute_on": "executeOn",
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
/** @internal */
|
|
45
|
+
export type GuardrailRef$Outbound = {
|
|
46
|
+
execute_on: string;
|
|
47
|
+
id: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export const GuardrailRef$outboundSchema: z.ZodType<
|
|
52
|
+
GuardrailRef$Outbound,
|
|
53
|
+
z.ZodTypeDef,
|
|
54
|
+
GuardrailRef
|
|
55
|
+
> = z.object({
|
|
56
|
+
executeOn: ExecuteOn$outboundSchema,
|
|
57
|
+
id: z.string(),
|
|
58
|
+
}).transform((v) => {
|
|
59
|
+
return remap$(v, {
|
|
60
|
+
executeOn: "execute_on",
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export function guardrailRefToJSON(guardrailRef: GuardrailRef): string {
|
|
65
|
+
return JSON.stringify(GuardrailRef$outboundSchema.parse(guardrailRef));
|
|
66
|
+
}
|
|
67
|
+
export function guardrailRefFromJSON(
|
|
68
|
+
jsonString: string,
|
|
69
|
+
): SafeParseResult<GuardrailRef, SDKValidationError> {
|
|
70
|
+
return safeParse(
|
|
71
|
+
jsonString,
|
|
72
|
+
(x) => GuardrailRef$inboundSchema.parse(JSON.parse(x)),
|
|
73
|
+
`Failed to parse 'GuardrailRef' from JSON`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import { Expression, Expression$inboundSchema } from "./expression.js";
|
|
11
|
+
import { GuardrailRef, GuardrailRef$inboundSchema } from "./guardrailref.js";
|
|
12
|
+
|
|
13
|
+
export type GuardrailRuleDocument = {
|
|
14
|
+
id: string;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
createdById: string;
|
|
17
|
+
description?: string | undefined;
|
|
18
|
+
displayName: string;
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
expression?: Expression | undefined;
|
|
21
|
+
guardrails?: Array<GuardrailRef> | null | undefined;
|
|
22
|
+
projectId: string;
|
|
23
|
+
timeout: number;
|
|
24
|
+
updatedAt: Date;
|
|
25
|
+
updatedById: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const GuardrailRuleDocument$inboundSchema: z.ZodType<
|
|
30
|
+
GuardrailRuleDocument,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
unknown
|
|
33
|
+
> = z.object({
|
|
34
|
+
_id: z.string(),
|
|
35
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
36
|
+
created_by_id: z.string(),
|
|
37
|
+
description: z.string().optional(),
|
|
38
|
+
display_name: z.string(),
|
|
39
|
+
enabled: z.boolean(),
|
|
40
|
+
expression: Expression$inboundSchema.optional(),
|
|
41
|
+
guardrails: z.nullable(z.array(GuardrailRef$inboundSchema)).optional(),
|
|
42
|
+
project_id: z.string(),
|
|
43
|
+
timeout: z.number().int(),
|
|
44
|
+
updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
45
|
+
updated_by_id: z.string(),
|
|
46
|
+
}).transform((v) => {
|
|
47
|
+
return remap$(v, {
|
|
48
|
+
"_id": "id",
|
|
49
|
+
"created_at": "createdAt",
|
|
50
|
+
"created_by_id": "createdById",
|
|
51
|
+
"display_name": "displayName",
|
|
52
|
+
"project_id": "projectId",
|
|
53
|
+
"updated_at": "updatedAt",
|
|
54
|
+
"updated_by_id": "updatedById",
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export function guardrailRuleDocumentFromJSON(
|
|
59
|
+
jsonString: string,
|
|
60
|
+
): SafeParseResult<GuardrailRuleDocument, SDKValidationError> {
|
|
61
|
+
return safeParse(
|
|
62
|
+
jsonString,
|
|
63
|
+
(x) => GuardrailRuleDocument$inboundSchema.parse(JSON.parse(x)),
|
|
64
|
+
`Failed to parse 'GuardrailRuleDocument' from JSON`,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -13,34 +13,46 @@ export * from "./agentresponsemessage.js";
|
|
|
13
13
|
export * from "./agentstartedstreamingevent.js";
|
|
14
14
|
export * from "./agentthoughtstreamingevent.js";
|
|
15
15
|
export * from "./audiocontentpartschema.js";
|
|
16
|
+
export * from "./budgetlimit.js";
|
|
16
17
|
export * from "./createagentresponse.js";
|
|
17
18
|
export * from "./datapart.js";
|
|
18
19
|
export * from "./errorpart.js";
|
|
19
20
|
export * from "./errorstreamingevent.js";
|
|
21
|
+
export * from "./evaluatorref.js";
|
|
20
22
|
export * from "./executionnamedstreamingevent.js";
|
|
21
23
|
export * from "./executionreviewedstreamingevent.js";
|
|
22
24
|
export * from "./executionreviewrequiredstreamingevent.js";
|
|
25
|
+
export * from "./expression.js";
|
|
23
26
|
export * from "./extendedmessage.js";
|
|
24
27
|
export * from "./filecontentpartschema.js";
|
|
25
28
|
export * from "./filedocument.js";
|
|
26
29
|
export * from "./filepart.js";
|
|
27
30
|
export * from "./getagentresponse.js";
|
|
31
|
+
export * from "./guardrailref.js";
|
|
32
|
+
export * from "./guardrailruledocument.js";
|
|
28
33
|
export * from "./imagecontentpartschema.js";
|
|
29
34
|
export * from "./invokedeploymentrequest.js";
|
|
35
|
+
export * from "./limits.js";
|
|
36
|
+
export * from "./modelref.js";
|
|
37
|
+
export * from "./modelsconfig.js";
|
|
30
38
|
export * from "./partdelta.js";
|
|
31
39
|
export * from "./partdeltaevent.js";
|
|
32
40
|
export * from "./partdoneevent.js";
|
|
41
|
+
export * from "./policydocument.js";
|
|
33
42
|
export * from "./publiccontact.js";
|
|
34
43
|
export * from "./publicidentity.js";
|
|
35
44
|
export * from "./reasoningpart.js";
|
|
36
45
|
export * from "./reasoningpartschema.js";
|
|
37
46
|
export * from "./redactedreasoningpartschema.js";
|
|
38
47
|
export * from "./refusalpartschema.js";
|
|
48
|
+
export * from "./requestlimit.js";
|
|
39
49
|
export * from "./responsedoneevent.js";
|
|
40
50
|
export * from "./responsefailedevent.js";
|
|
41
51
|
export * from "./responsestartedevent.js";
|
|
42
52
|
export * from "./responsestreamingevent.js";
|
|
53
|
+
export * from "./retryconfig.js";
|
|
43
54
|
export * from "./reviewoutcome.js";
|
|
55
|
+
export * from "./routingruledocument.js";
|
|
44
56
|
export * from "./security.js";
|
|
45
57
|
export * from "./telemetry.js";
|
|
46
58
|
export * from "./textcontentpartschema.js";
|
|
@@ -49,6 +61,7 @@ export * from "./thinkingconfigadaptiveschema.js";
|
|
|
49
61
|
export * from "./thinkingconfigdisabledschema.js";
|
|
50
62
|
export * from "./thinkingconfigenabledschema.js";
|
|
51
63
|
export * from "./timeoutstreamingevent.js";
|
|
64
|
+
export * from "./tokenlimit.js";
|
|
52
65
|
export * from "./toolcallpart.js";
|
|
53
66
|
export * from "./tooldoneevent.js";
|
|
54
67
|
export * from "./toolexecutionfailedstreamingevent.js";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
BudgetLimit,
|
|
11
|
+
BudgetLimit$inboundSchema,
|
|
12
|
+
BudgetLimit$Outbound,
|
|
13
|
+
BudgetLimit$outboundSchema,
|
|
14
|
+
} from "./budgetlimit.js";
|
|
15
|
+
import {
|
|
16
|
+
RequestLimit,
|
|
17
|
+
RequestLimit$inboundSchema,
|
|
18
|
+
RequestLimit$Outbound,
|
|
19
|
+
RequestLimit$outboundSchema,
|
|
20
|
+
} from "./requestlimit.js";
|
|
21
|
+
import {
|
|
22
|
+
TokenLimit,
|
|
23
|
+
TokenLimit$inboundSchema,
|
|
24
|
+
TokenLimit$Outbound,
|
|
25
|
+
TokenLimit$outboundSchema,
|
|
26
|
+
} from "./tokenlimit.js";
|
|
27
|
+
|
|
28
|
+
export type Limits = {
|
|
29
|
+
budget?: BudgetLimit | undefined;
|
|
30
|
+
requests?: RequestLimit | undefined;
|
|
31
|
+
tokens?: TokenLimit | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const Limits$inboundSchema: z.ZodType<Limits, z.ZodTypeDef, unknown> = z
|
|
36
|
+
.object({
|
|
37
|
+
budget: BudgetLimit$inboundSchema.optional(),
|
|
38
|
+
requests: RequestLimit$inboundSchema.optional(),
|
|
39
|
+
tokens: TokenLimit$inboundSchema.optional(),
|
|
40
|
+
});
|
|
41
|
+
/** @internal */
|
|
42
|
+
export type Limits$Outbound = {
|
|
43
|
+
budget?: BudgetLimit$Outbound | undefined;
|
|
44
|
+
requests?: RequestLimit$Outbound | undefined;
|
|
45
|
+
tokens?: TokenLimit$Outbound | undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const Limits$outboundSchema: z.ZodType<
|
|
50
|
+
Limits$Outbound,
|
|
51
|
+
z.ZodTypeDef,
|
|
52
|
+
Limits
|
|
53
|
+
> = z.object({
|
|
54
|
+
budget: BudgetLimit$outboundSchema.optional(),
|
|
55
|
+
requests: RequestLimit$outboundSchema.optional(),
|
|
56
|
+
tokens: TokenLimit$outboundSchema.optional(),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export function limitsToJSON(limits: Limits): string {
|
|
60
|
+
return JSON.stringify(Limits$outboundSchema.parse(limits));
|
|
61
|
+
}
|
|
62
|
+
export function limitsFromJSON(
|
|
63
|
+
jsonString: string,
|
|
64
|
+
): SafeParseResult<Limits, SDKValidationError> {
|
|
65
|
+
return safeParse(
|
|
66
|
+
jsonString,
|
|
67
|
+
(x) => Limits$inboundSchema.parse(JSON.parse(x)),
|
|
68
|
+
`Failed to parse 'Limits' from JSON`,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type ModelRef = {
|
|
12
|
+
integrationId?: string | undefined;
|
|
13
|
+
model: string;
|
|
14
|
+
weight?: number | undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ModelRef$inboundSchema: z.ZodType<
|
|
19
|
+
ModelRef,
|
|
20
|
+
z.ZodTypeDef,
|
|
21
|
+
unknown
|
|
22
|
+
> = z.object({
|
|
23
|
+
integration_id: z.string().optional(),
|
|
24
|
+
model: z.string(),
|
|
25
|
+
weight: z.number().optional(),
|
|
26
|
+
}).transform((v) => {
|
|
27
|
+
return remap$(v, {
|
|
28
|
+
"integration_id": "integrationId",
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type ModelRef$Outbound = {
|
|
33
|
+
integration_id?: string | undefined;
|
|
34
|
+
model: string;
|
|
35
|
+
weight?: number | undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const ModelRef$outboundSchema: z.ZodType<
|
|
40
|
+
ModelRef$Outbound,
|
|
41
|
+
z.ZodTypeDef,
|
|
42
|
+
ModelRef
|
|
43
|
+
> = z.object({
|
|
44
|
+
integrationId: z.string().optional(),
|
|
45
|
+
model: z.string(),
|
|
46
|
+
weight: z.number().optional(),
|
|
47
|
+
}).transform((v) => {
|
|
48
|
+
return remap$(v, {
|
|
49
|
+
integrationId: "integration_id",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export function modelRefToJSON(modelRef: ModelRef): string {
|
|
54
|
+
return JSON.stringify(ModelRef$outboundSchema.parse(modelRef));
|
|
55
|
+
}
|
|
56
|
+
export function modelRefFromJSON(
|
|
57
|
+
jsonString: string,
|
|
58
|
+
): SafeParseResult<ModelRef, SDKValidationError> {
|
|
59
|
+
return safeParse(
|
|
60
|
+
jsonString,
|
|
61
|
+
(x) => ModelRef$inboundSchema.parse(JSON.parse(x)),
|
|
62
|
+
`Failed to parse 'ModelRef' from JSON`,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
ModelRef,
|
|
12
|
+
ModelRef$inboundSchema,
|
|
13
|
+
ModelRef$Outbound,
|
|
14
|
+
ModelRef$outboundSchema,
|
|
15
|
+
} from "./modelref.js";
|
|
16
|
+
|
|
17
|
+
export const Mode = {
|
|
18
|
+
Fallback: "fallback",
|
|
19
|
+
Weighted: "weighted",
|
|
20
|
+
RoundRobin: "round_robin",
|
|
21
|
+
} as const;
|
|
22
|
+
export type Mode = ClosedEnum<typeof Mode>;
|
|
23
|
+
|
|
24
|
+
export type ModelsConfig = {
|
|
25
|
+
mode: Mode;
|
|
26
|
+
models: Array<ModelRef> | null;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const Mode$inboundSchema: z.ZodNativeEnum<typeof Mode> = z.nativeEnum(
|
|
31
|
+
Mode,
|
|
32
|
+
);
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const Mode$outboundSchema: z.ZodNativeEnum<typeof Mode> =
|
|
35
|
+
Mode$inboundSchema;
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const ModelsConfig$inboundSchema: z.ZodType<
|
|
39
|
+
ModelsConfig,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
unknown
|
|
42
|
+
> = z.object({
|
|
43
|
+
mode: Mode$inboundSchema,
|
|
44
|
+
models: z.nullable(z.array(ModelRef$inboundSchema)),
|
|
45
|
+
});
|
|
46
|
+
/** @internal */
|
|
47
|
+
export type ModelsConfig$Outbound = {
|
|
48
|
+
mode: string;
|
|
49
|
+
models: Array<ModelRef$Outbound> | null;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const ModelsConfig$outboundSchema: z.ZodType<
|
|
54
|
+
ModelsConfig$Outbound,
|
|
55
|
+
z.ZodTypeDef,
|
|
56
|
+
ModelsConfig
|
|
57
|
+
> = z.object({
|
|
58
|
+
mode: Mode$outboundSchema,
|
|
59
|
+
models: z.nullable(z.array(ModelRef$outboundSchema)),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export function modelsConfigToJSON(modelsConfig: ModelsConfig): string {
|
|
63
|
+
return JSON.stringify(ModelsConfig$outboundSchema.parse(modelsConfig));
|
|
64
|
+
}
|
|
65
|
+
export function modelsConfigFromJSON(
|
|
66
|
+
jsonString: string,
|
|
67
|
+
): SafeParseResult<ModelsConfig, SDKValidationError> {
|
|
68
|
+
return safeParse(
|
|
69
|
+
jsonString,
|
|
70
|
+
(x) => ModelsConfig$inboundSchema.parse(JSON.parse(x)),
|
|
71
|
+
`Failed to parse 'ModelsConfig' from JSON`,
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import { EvaluatorRef, EvaluatorRef$inboundSchema } from "./evaluatorref.js";
|
|
11
|
+
import { Limits, Limits$inboundSchema } from "./limits.js";
|
|
12
|
+
import { ModelsConfig, ModelsConfig$inboundSchema } from "./modelsconfig.js";
|
|
13
|
+
import { RetryConfig, RetryConfig$inboundSchema } from "./retryconfig.js";
|
|
14
|
+
|
|
15
|
+
export type PolicyDocument = {
|
|
16
|
+
id: string;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
createdById: string;
|
|
19
|
+
description?: string | undefined;
|
|
20
|
+
displayName: string;
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
evaluators?: Array<EvaluatorRef> | null | undefined;
|
|
23
|
+
limits?: Limits | undefined;
|
|
24
|
+
modelsConfig?: ModelsConfig | undefined;
|
|
25
|
+
projectId: string;
|
|
26
|
+
retryConfig?: RetryConfig | undefined;
|
|
27
|
+
slug: string;
|
|
28
|
+
timeout: number;
|
|
29
|
+
updatedAt: Date;
|
|
30
|
+
updatedById: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const PolicyDocument$inboundSchema: z.ZodType<
|
|
35
|
+
PolicyDocument,
|
|
36
|
+
z.ZodTypeDef,
|
|
37
|
+
unknown
|
|
38
|
+
> = z.object({
|
|
39
|
+
_id: z.string(),
|
|
40
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
41
|
+
created_by_id: z.string(),
|
|
42
|
+
description: z.string().optional(),
|
|
43
|
+
display_name: z.string(),
|
|
44
|
+
enabled: z.boolean(),
|
|
45
|
+
evaluators: z.nullable(z.array(EvaluatorRef$inboundSchema)).optional(),
|
|
46
|
+
limits: Limits$inboundSchema.optional(),
|
|
47
|
+
models_config: ModelsConfig$inboundSchema.optional(),
|
|
48
|
+
project_id: z.string(),
|
|
49
|
+
retry_config: RetryConfig$inboundSchema.optional(),
|
|
50
|
+
slug: z.string(),
|
|
51
|
+
timeout: z.number().int(),
|
|
52
|
+
updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
53
|
+
updated_by_id: z.string(),
|
|
54
|
+
}).transform((v) => {
|
|
55
|
+
return remap$(v, {
|
|
56
|
+
"_id": "id",
|
|
57
|
+
"created_at": "createdAt",
|
|
58
|
+
"created_by_id": "createdById",
|
|
59
|
+
"display_name": "displayName",
|
|
60
|
+
"models_config": "modelsConfig",
|
|
61
|
+
"project_id": "projectId",
|
|
62
|
+
"retry_config": "retryConfig",
|
|
63
|
+
"updated_at": "updatedAt",
|
|
64
|
+
"updated_by_id": "updatedById",
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export function policyDocumentFromJSON(
|
|
69
|
+
jsonString: string,
|
|
70
|
+
): SafeParseResult<PolicyDocument, SDKValidationError> {
|
|
71
|
+
return safeParse(
|
|
72
|
+
jsonString,
|
|
73
|
+
(x) => PolicyDocument$inboundSchema.parse(JSON.parse(x)),
|
|
74
|
+
`Failed to parse 'PolicyDocument' from JSON`,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -40,7 +40,7 @@ export const ReasoningPart$inboundSchema: z.ZodType<
|
|
|
40
40
|
z.ZodTypeDef,
|
|
41
41
|
unknown
|
|
42
42
|
> = z.object({
|
|
43
|
-
_id: z.string().default("
|
|
43
|
+
_id: z.string().default("reasoning_01kp5h1m4q53jxhw0zna3drnrd"),
|
|
44
44
|
metadata: z.record(z.any()).optional(),
|
|
45
45
|
kind: z.literal("reasoning"),
|
|
46
46
|
reasoning: z.string(),
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export const RequestLimitPeriod = {
|
|
12
|
+
Hour: "hour",
|
|
13
|
+
Day: "day",
|
|
14
|
+
Week: "week",
|
|
15
|
+
Month: "month",
|
|
16
|
+
} as const;
|
|
17
|
+
export type RequestLimitPeriod = ClosedEnum<typeof RequestLimitPeriod>;
|
|
18
|
+
|
|
19
|
+
export type RequestLimit = {
|
|
20
|
+
amount: number;
|
|
21
|
+
period: RequestLimitPeriod;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const RequestLimitPeriod$inboundSchema: z.ZodNativeEnum<
|
|
26
|
+
typeof RequestLimitPeriod
|
|
27
|
+
> = z.nativeEnum(RequestLimitPeriod);
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const RequestLimitPeriod$outboundSchema: z.ZodNativeEnum<
|
|
30
|
+
typeof RequestLimitPeriod
|
|
31
|
+
> = RequestLimitPeriod$inboundSchema;
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const RequestLimit$inboundSchema: z.ZodType<
|
|
35
|
+
RequestLimit,
|
|
36
|
+
z.ZodTypeDef,
|
|
37
|
+
unknown
|
|
38
|
+
> = z.object({
|
|
39
|
+
amount: z.number().int(),
|
|
40
|
+
period: RequestLimitPeriod$inboundSchema,
|
|
41
|
+
});
|
|
42
|
+
/** @internal */
|
|
43
|
+
export type RequestLimit$Outbound = {
|
|
44
|
+
amount: number;
|
|
45
|
+
period: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const RequestLimit$outboundSchema: z.ZodType<
|
|
50
|
+
RequestLimit$Outbound,
|
|
51
|
+
z.ZodTypeDef,
|
|
52
|
+
RequestLimit
|
|
53
|
+
> = z.object({
|
|
54
|
+
amount: z.number().int(),
|
|
55
|
+
period: RequestLimitPeriod$outboundSchema,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export function requestLimitToJSON(requestLimit: RequestLimit): string {
|
|
59
|
+
return JSON.stringify(RequestLimit$outboundSchema.parse(requestLimit));
|
|
60
|
+
}
|
|
61
|
+
export function requestLimitFromJSON(
|
|
62
|
+
jsonString: string,
|
|
63
|
+
): SafeParseResult<RequestLimit, SDKValidationError> {
|
|
64
|
+
return safeParse(
|
|
65
|
+
jsonString,
|
|
66
|
+
(x) => RequestLimit$inboundSchema.parse(JSON.parse(x)),
|
|
67
|
+
`Failed to parse 'RequestLimit' from JSON`,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type RetryConfig = {
|
|
12
|
+
count: number;
|
|
13
|
+
onCodes?: Array<number> | null | undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const RetryConfig$inboundSchema: z.ZodType<
|
|
18
|
+
RetryConfig,
|
|
19
|
+
z.ZodTypeDef,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.object({
|
|
22
|
+
count: z.number().int(),
|
|
23
|
+
on_codes: z.nullable(z.array(z.number().int())).optional(),
|
|
24
|
+
}).transform((v) => {
|
|
25
|
+
return remap$(v, {
|
|
26
|
+
"on_codes": "onCodes",
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type RetryConfig$Outbound = {
|
|
31
|
+
count: number;
|
|
32
|
+
on_codes?: Array<number> | null | undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const RetryConfig$outboundSchema: z.ZodType<
|
|
37
|
+
RetryConfig$Outbound,
|
|
38
|
+
z.ZodTypeDef,
|
|
39
|
+
RetryConfig
|
|
40
|
+
> = z.object({
|
|
41
|
+
count: z.number().int(),
|
|
42
|
+
onCodes: z.nullable(z.array(z.number().int())).optional(),
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
onCodes: "on_codes",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export function retryConfigToJSON(retryConfig: RetryConfig): string {
|
|
50
|
+
return JSON.stringify(RetryConfig$outboundSchema.parse(retryConfig));
|
|
51
|
+
}
|
|
52
|
+
export function retryConfigFromJSON(
|
|
53
|
+
jsonString: string,
|
|
54
|
+
): SafeParseResult<RetryConfig, SDKValidationError> {
|
|
55
|
+
return safeParse(
|
|
56
|
+
jsonString,
|
|
57
|
+
(x) => RetryConfig$inboundSchema.parse(JSON.parse(x)),
|
|
58
|
+
`Failed to parse 'RetryConfig' from JSON`,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import { Expression, Expression$inboundSchema } from "./expression.js";
|
|
11
|
+
import { ModelsConfig, ModelsConfig$inboundSchema } from "./modelsconfig.js";
|
|
12
|
+
|
|
13
|
+
export type RoutingRuleDocument = {
|
|
14
|
+
id: string;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
createdById: string;
|
|
17
|
+
description?: string | undefined;
|
|
18
|
+
displayName: string;
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
expression?: Expression | undefined;
|
|
21
|
+
modelsConfig?: ModelsConfig | undefined;
|
|
22
|
+
priority: number;
|
|
23
|
+
projectId: string;
|
|
24
|
+
updatedAt: Date;
|
|
25
|
+
updatedById: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const RoutingRuleDocument$inboundSchema: z.ZodType<
|
|
30
|
+
RoutingRuleDocument,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
unknown
|
|
33
|
+
> = z.object({
|
|
34
|
+
_id: z.string(),
|
|
35
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
36
|
+
created_by_id: z.string(),
|
|
37
|
+
description: z.string().optional(),
|
|
38
|
+
display_name: z.string(),
|
|
39
|
+
enabled: z.boolean(),
|
|
40
|
+
expression: Expression$inboundSchema.optional(),
|
|
41
|
+
models_config: ModelsConfig$inboundSchema.optional(),
|
|
42
|
+
priority: z.number().int(),
|
|
43
|
+
project_id: z.string(),
|
|
44
|
+
updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
45
|
+
updated_by_id: z.string(),
|
|
46
|
+
}).transform((v) => {
|
|
47
|
+
return remap$(v, {
|
|
48
|
+
"_id": "id",
|
|
49
|
+
"created_at": "createdAt",
|
|
50
|
+
"created_by_id": "createdById",
|
|
51
|
+
"display_name": "displayName",
|
|
52
|
+
"models_config": "modelsConfig",
|
|
53
|
+
"project_id": "projectId",
|
|
54
|
+
"updated_at": "updatedAt",
|
|
55
|
+
"updated_by_id": "updatedById",
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export function routingRuleDocumentFromJSON(
|
|
60
|
+
jsonString: string,
|
|
61
|
+
): SafeParseResult<RoutingRuleDocument, SDKValidationError> {
|
|
62
|
+
return safeParse(
|
|
63
|
+
jsonString,
|
|
64
|
+
(x) => RoutingRuleDocument$inboundSchema.parse(JSON.parse(x)),
|
|
65
|
+
`Failed to parse 'RoutingRuleDocument' from JSON`,
|
|
66
|
+
);
|
|
67
|
+
}
|