@orq-ai/node 4.8.0-rc.7 → 4.8.0-rc.9
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 +78 -39
- package/funcs/guardrailRulesCreate.d.ts +17 -0
- package/funcs/guardrailRulesCreate.d.ts.map +1 -0
- package/funcs/guardrailRulesCreate.js +114 -0
- package/funcs/guardrailRulesCreate.js.map +1 -0
- package/funcs/guardrailRulesDelete.d.ts +17 -0
- package/funcs/guardrailRulesDelete.d.ts.map +1 -0
- package/funcs/guardrailRulesDelete.js +117 -0
- package/funcs/guardrailRulesDelete.js.map +1 -0
- package/funcs/guardrailRulesGet.d.ts +17 -0
- package/funcs/guardrailRulesGet.d.ts.map +1 -0
- package/funcs/guardrailRulesGet.js +116 -0
- package/funcs/guardrailRulesGet.js.map +1 -0
- package/funcs/guardrailRulesList.d.ts +17 -0
- package/funcs/guardrailRulesList.d.ts.map +1 -0
- package/funcs/guardrailRulesList.js +120 -0
- package/funcs/guardrailRulesList.js.map +1 -0
- package/funcs/guardrailRulesUpdate.d.ts +17 -0
- package/funcs/guardrailRulesUpdate.d.ts.map +1 -0
- package/funcs/guardrailRulesUpdate.js +117 -0
- package/funcs/guardrailRulesUpdate.js.map +1 -0
- package/funcs/policiesCreate.d.ts +17 -0
- package/funcs/policiesCreate.d.ts.map +1 -0
- package/funcs/policiesCreate.js +114 -0
- package/funcs/policiesCreate.js.map +1 -0
- package/funcs/policiesDelete.d.ts +17 -0
- package/funcs/policiesDelete.d.ts.map +1 -0
- package/funcs/policiesDelete.js +120 -0
- package/funcs/policiesDelete.js.map +1 -0
- package/funcs/policiesGet.d.ts +17 -0
- package/funcs/policiesGet.d.ts.map +1 -0
- package/funcs/policiesGet.js +119 -0
- package/funcs/policiesGet.js.map +1 -0
- package/funcs/policiesList.d.ts +17 -0
- package/funcs/policiesList.d.ts.map +1 -0
- package/funcs/policiesList.js +120 -0
- package/funcs/policiesList.js.map +1 -0
- package/funcs/policiesUpdate.d.ts +17 -0
- package/funcs/policiesUpdate.d.ts.map +1 -0
- package/funcs/policiesUpdate.js +120 -0
- package/funcs/policiesUpdate.js.map +1 -0
- package/funcs/routingRulesCreate.d.ts +17 -0
- package/funcs/routingRulesCreate.d.ts.map +1 -0
- package/funcs/routingRulesCreate.js +114 -0
- package/funcs/routingRulesCreate.js.map +1 -0
- package/funcs/routingRulesDelete.d.ts +17 -0
- package/funcs/routingRulesDelete.d.ts.map +1 -0
- package/funcs/routingRulesDelete.js +120 -0
- package/funcs/routingRulesDelete.js.map +1 -0
- package/funcs/routingRulesGet.d.ts +17 -0
- package/funcs/routingRulesGet.d.ts.map +1 -0
- package/funcs/routingRulesGet.js +119 -0
- package/funcs/routingRulesGet.js.map +1 -0
- package/funcs/routingRulesList.d.ts +17 -0
- package/funcs/routingRulesList.d.ts.map +1 -0
- package/funcs/routingRulesList.js +120 -0
- package/funcs/routingRulesList.js.map +1 -0
- package/funcs/routingRulesUpdate.d.ts +17 -0
- package/funcs/routingRulesUpdate.d.ts.map +1 -0
- package/funcs/routingRulesUpdate.js +120 -0
- package/funcs/routingRulesUpdate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/agentstartedstreamingevent.d.ts +4 -4
- package/models/components/agentstartedstreamingevent.d.ts.map +1 -1
- package/models/components/agentstartedstreamingevent.js +5 -5
- package/models/components/agentstartedstreamingevent.js.map +1 -1
- package/models/components/budgetlimit.d.ts +41 -0
- package/models/components/budgetlimit.d.ts.map +1 -0
- package/models/components/budgetlimit.js +81 -0
- package/models/components/budgetlimit.js.map +1 -0
- package/models/components/evaluatorref.d.ts +34 -0
- package/models/components/evaluatorref.d.ts.map +1 -0
- package/models/components/evaluatorref.js +86 -0
- package/models/components/evaluatorref.js.map +1 -0
- package/models/components/expression.d.ts +23 -0
- package/models/components/expression.d.ts.map +1 -0
- package/models/components/expression.js +60 -0
- package/models/components/expression.js.map +1 -0
- package/models/components/guardrailref.d.ts +30 -0
- package/models/components/guardrailref.d.ts.map +1 -0
- package/models/components/guardrailref.js +79 -0
- package/models/components/guardrailref.js.map +1 -0
- package/models/components/guardrailruledocument.d.ts +23 -0
- package/models/components/guardrailruledocument.d.ts.map +1 -0
- package/models/components/guardrailruledocument.js +74 -0
- package/models/components/guardrailruledocument.js.map +1 -0
- 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/limits.d.ts +24 -0
- package/models/components/limits.d.ts.map +1 -0
- package/models/components/limits.js +66 -0
- package/models/components/limits.js.map +1 -0
- package/models/components/modelref.d.ts +21 -0
- package/models/components/modelref.d.ts.map +1 -0
- package/models/components/modelref.js +71 -0
- package/models/components/modelref.js.map +1 -0
- package/models/components/modelsconfig.d.ts +31 -0
- package/models/components/modelsconfig.d.ts.map +1 -0
- package/models/components/modelsconfig.js +70 -0
- package/models/components/modelsconfig.js.map +1 -0
- package/models/components/policydocument.d.ts +28 -0
- package/models/components/policydocument.d.ts.map +1 -0
- package/models/components/policydocument.js +81 -0
- package/models/components/policydocument.js.map +1 -0
- package/models/components/reasoningpart.js +1 -1
- package/models/components/requestlimit.d.ts +31 -0
- package/models/components/requestlimit.d.ts.map +1 -0
- package/models/components/requestlimit.js +70 -0
- package/models/components/requestlimit.js.map +1 -0
- package/models/components/retryconfig.d.ts +19 -0
- package/models/components/retryconfig.d.ts.map +1 -0
- package/models/components/retryconfig.js +69 -0
- package/models/components/retryconfig.js.map +1 -0
- package/models/components/routingruledocument.d.ts +23 -0
- package/models/components/routingruledocument.d.ts.map +1 -0
- package/models/components/routingruledocument.js +75 -0
- package/models/components/routingruledocument.js.map +1 -0
- package/models/components/tokenlimit.d.ts +31 -0
- package/models/components/tokenlimit.d.ts.map +1 -0
- package/models/components/tokenlimit.js +70 -0
- package/models/components/tokenlimit.js.map +1 -0
- 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.d.ts +42 -42
- package/models/operations/createeval.d.ts.map +1 -1
- package/models/operations/createeval.js +64 -63
- package/models/operations/createeval.js.map +1 -1
- package/models/operations/createidentity.js +1 -1
- package/models/operations/createtool.js +6 -6
- 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/guardrailrulecreate.d.ts +50 -0
- package/models/operations/guardrailrulecreate.d.ts.map +1 -0
- package/models/operations/guardrailrulecreate.js +94 -0
- package/models/operations/guardrailrulecreate.js.map +1 -0
- package/models/operations/guardrailruledelete.d.ts +15 -0
- package/models/operations/guardrailruledelete.d.ts.map +1 -0
- package/models/operations/guardrailruledelete.js +54 -0
- package/models/operations/guardrailruledelete.js.map +1 -0
- package/models/operations/guardrailruleget.d.ts +38 -0
- package/models/operations/guardrailruleget.d.ts.map +1 -0
- package/models/operations/guardrailruleget.js +86 -0
- package/models/operations/guardrailruleget.js.map +1 -0
- package/models/operations/guardrailrulelist.d.ts +41 -0
- package/models/operations/guardrailrulelist.d.ts.map +1 -0
- package/models/operations/guardrailrulelist.js +75 -0
- package/models/operations/guardrailrulelist.js.map +1 -0
- package/models/operations/guardrailruleupdate.d.ts +60 -0
- package/models/operations/guardrailruleupdate.d.ts.map +1 -0
- package/models/operations/guardrailruleupdate.js +105 -0
- package/models/operations/guardrailruleupdate.js.map +1 -0
- package/models/operations/index.d.ts +15 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +15 -0
- package/models/operations/index.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/listidentities.js +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/patchv2humanevalsid.js +12 -12
- package/models/operations/policycreate.d.ts +57 -0
- package/models/operations/policycreate.d.ts.map +1 -0
- package/models/operations/policycreate.js +103 -0
- package/models/operations/policycreate.js.map +1 -0
- package/models/operations/policydelete.d.ts +15 -0
- package/models/operations/policydelete.d.ts.map +1 -0
- package/models/operations/policydelete.js +54 -0
- package/models/operations/policydelete.js.map +1 -0
- package/models/operations/policyget.d.ts +41 -0
- package/models/operations/policyget.d.ts.map +1 -0
- package/models/operations/policyget.js +91 -0
- package/models/operations/policyget.js.map +1 -0
- package/models/operations/policylist.d.ts +41 -0
- package/models/operations/policylist.d.ts.map +1 -0
- package/models/operations/policylist.js +75 -0
- package/models/operations/policylist.js.map +1 -0
- package/models/operations/policyupdate.d.ts +67 -0
- package/models/operations/policyupdate.d.ts.map +1 -0
- package/models/operations/policyupdate.js +114 -0
- package/models/operations/policyupdate.js.map +1 -0
- 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/routingrulecreate.d.ts +50 -0
- package/models/operations/routingrulecreate.d.ts.map +1 -0
- package/models/operations/routingrulecreate.js +94 -0
- package/models/operations/routingrulecreate.js.map +1 -0
- package/models/operations/routingruledelete.d.ts +15 -0
- package/models/operations/routingruledelete.d.ts.map +1 -0
- package/models/operations/routingruledelete.js +54 -0
- package/models/operations/routingruledelete.js.map +1 -0
- package/models/operations/routingruleget.d.ts +38 -0
- package/models/operations/routingruleget.d.ts.map +1 -0
- package/models/operations/routingruleget.js +86 -0
- package/models/operations/routingruleget.js.map +1 -0
- package/models/operations/routingrulelist.d.ts +41 -0
- package/models/operations/routingrulelist.d.ts.map +1 -0
- package/models/operations/routingrulelist.js +75 -0
- package/models/operations/routingrulelist.js.map +1 -0
- package/models/operations/routingruleupdate.d.ts +60 -0
- package/models/operations/routingruleupdate.d.ts.map +1 -0
- package/models/operations/routingruleupdate.js +106 -0
- package/models/operations/routingruleupdate.js.map +1 -0
- 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.d.ts +69 -0
- package/models/operations/updateeval.d.ts.map +1 -1
- package/models/operations/updateeval.js +92 -19
- package/models/operations/updateeval.js.map +1 -1
- package/models/operations/updateidentity.js +1 -1
- package/models/operations/updatetool.js +7 -7
- package/package.json +1 -1
- package/sdk/guardrailrules.d.ts +40 -0
- package/sdk/guardrailrules.d.ts.map +1 -0
- package/sdk/guardrailrules.js +62 -0
- package/sdk/guardrailrules.js.map +1 -0
- package/sdk/policies.d.ts +40 -0
- package/sdk/policies.d.ts.map +1 -0
- package/sdk/policies.js +62 -0
- package/sdk/policies.js.map +1 -0
- package/sdk/routingrules.d.ts +40 -0
- package/sdk/routingrules.d.ts.map +1 -0
- package/sdk/routingrules.js +62 -0
- package/sdk/routingrules.js.map +1 -0
- package/sdk/sdk.d.ts +9 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +12 -0
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/guardrailRulesCreate.ts +161 -0
- package/src/funcs/guardrailRulesDelete.ts +170 -0
- package/src/funcs/guardrailRulesGet.ts +168 -0
- package/src/funcs/guardrailRulesList.ts +170 -0
- package/src/funcs/guardrailRulesUpdate.ts +170 -0
- package/src/funcs/policiesCreate.ts +160 -0
- package/src/funcs/policiesDelete.ts +166 -0
- package/src/funcs/policiesGet.ts +165 -0
- package/src/funcs/policiesList.ts +168 -0
- package/src/funcs/policiesUpdate.ts +166 -0
- package/src/funcs/routingRulesCreate.ts +161 -0
- package/src/funcs/routingRulesDelete.ts +166 -0
- package/src/funcs/routingRulesGet.ts +165 -0
- package/src/funcs/routingRulesList.ts +168 -0
- package/src/funcs/routingRulesUpdate.ts +166 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/agentstartedstreamingevent.ts +9 -6
- package/src/models/components/budgetlimit.ts +83 -0
- package/src/models/components/evaluatorref.ts +89 -0
- package/src/models/components/expression.ts +51 -0
- package/src/models/components/guardrailref.ts +75 -0
- package/src/models/components/guardrailruledocument.ts +66 -0
- package/src/models/components/index.ts +13 -0
- package/src/models/components/limits.ts +70 -0
- package/src/models/components/modelref.ts +64 -0
- package/src/models/components/modelsconfig.ts +73 -0
- package/src/models/components/policydocument.ts +76 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/components/requestlimit.ts +69 -0
- package/src/models/components/retryconfig.ts +60 -0
- package/src/models/components/routingruledocument.ts +67 -0
- package/src/models/components/tokenlimit.ts +69 -0
- 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 +213 -160
- package/src/models/operations/createidentity.ts +1 -1
- package/src/models/operations/createtool.ts +6 -6
- 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/guardrailrulecreate.ts +124 -0
- package/src/models/operations/guardrailruledelete.ts +39 -0
- package/src/models/operations/guardrailruleget.ts +102 -0
- package/src/models/operations/guardrailrulelist.ts +94 -0
- package/src/models/operations/guardrailruleupdate.ts +153 -0
- package/src/models/operations/index.ts +15 -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/listidentities.ts +1 -1
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/patchv2humanevalsid.ts +12 -12
- package/src/models/operations/policycreate.ts +138 -0
- package/src/models/operations/policydelete.ts +39 -0
- package/src/models/operations/policyget.ts +110 -0
- package/src/models/operations/policylist.ts +94 -0
- package/src/models/operations/policyupdate.ts +167 -0
- 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/routingrulecreate.ts +124 -0
- package/src/models/operations/routingruledelete.ts +39 -0
- package/src/models/operations/routingruleget.ts +102 -0
- package/src/models/operations/routingrulelist.ts +94 -0
- package/src/models/operations/routingruleupdate.ts +154 -0
- 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 +178 -16
- package/src/models/operations/updateidentity.ts +1 -1
- package/src/models/operations/updatetool.ts +7 -7
- package/src/sdk/guardrailrules.ts +99 -0
- package/src/sdk/policies.ts +99 -0
- package/src/sdk/routingrules.ts +99 -0
- package/src/sdk/sdk.ts +18 -0
|
@@ -112,14 +112,16 @@ export type Tools = {
|
|
|
112
112
|
/**
|
|
113
113
|
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
114
114
|
*/
|
|
115
|
-
export const
|
|
115
|
+
export const AgentStartedStreamingEventDataExecuteOn = {
|
|
116
116
|
Input: "input",
|
|
117
117
|
Output: "output",
|
|
118
118
|
} as const;
|
|
119
119
|
/**
|
|
120
120
|
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
121
121
|
*/
|
|
122
|
-
export type
|
|
122
|
+
export type AgentStartedStreamingEventDataExecuteOn = ClosedEnum<
|
|
123
|
+
typeof AgentStartedStreamingEventDataExecuteOn
|
|
124
|
+
>;
|
|
123
125
|
|
|
124
126
|
export type Evaluators = {
|
|
125
127
|
/**
|
|
@@ -133,7 +135,7 @@ export type Evaluators = {
|
|
|
133
135
|
/**
|
|
134
136
|
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
135
137
|
*/
|
|
136
|
-
executeOn:
|
|
138
|
+
executeOn: AgentStartedStreamingEventDataExecuteOn;
|
|
137
139
|
};
|
|
138
140
|
|
|
139
141
|
/**
|
|
@@ -352,8 +354,9 @@ export function toolsFromJSON(
|
|
|
352
354
|
}
|
|
353
355
|
|
|
354
356
|
/** @internal */
|
|
355
|
-
export const
|
|
356
|
-
.
|
|
357
|
+
export const AgentStartedStreamingEventDataExecuteOn$inboundSchema:
|
|
358
|
+
z.ZodNativeEnum<typeof AgentStartedStreamingEventDataExecuteOn> = z
|
|
359
|
+
.nativeEnum(AgentStartedStreamingEventDataExecuteOn);
|
|
357
360
|
|
|
358
361
|
/** @internal */
|
|
359
362
|
export const Evaluators$inboundSchema: z.ZodType<
|
|
@@ -363,7 +366,7 @@ export const Evaluators$inboundSchema: z.ZodType<
|
|
|
363
366
|
> = z.object({
|
|
364
367
|
id: z.string(),
|
|
365
368
|
sample_rate: z.number().default(50),
|
|
366
|
-
execute_on:
|
|
369
|
+
execute_on: AgentStartedStreamingEventDataExecuteOn$inboundSchema,
|
|
367
370
|
}).transform((v) => {
|
|
368
371
|
return remap$(v, {
|
|
369
372
|
"sample_rate": "sampleRate",
|
|
@@ -0,0 +1,83 @@
|
|
|
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 Currency = {
|
|
12
|
+
Usd: "usd",
|
|
13
|
+
} as const;
|
|
14
|
+
export type Currency = ClosedEnum<typeof Currency>;
|
|
15
|
+
|
|
16
|
+
export const Period = {
|
|
17
|
+
Hour: "hour",
|
|
18
|
+
Day: "day",
|
|
19
|
+
Week: "week",
|
|
20
|
+
Month: "month",
|
|
21
|
+
} as const;
|
|
22
|
+
export type Period = ClosedEnum<typeof Period>;
|
|
23
|
+
|
|
24
|
+
export type BudgetLimit = {
|
|
25
|
+
amount: number;
|
|
26
|
+
currency: Currency;
|
|
27
|
+
period: Period;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const Currency$inboundSchema: z.ZodNativeEnum<typeof Currency> = z
|
|
32
|
+
.nativeEnum(Currency);
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const Currency$outboundSchema: z.ZodNativeEnum<typeof Currency> =
|
|
35
|
+
Currency$inboundSchema;
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const Period$inboundSchema: z.ZodNativeEnum<typeof Period> = z
|
|
39
|
+
.nativeEnum(Period);
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const Period$outboundSchema: z.ZodNativeEnum<typeof Period> =
|
|
42
|
+
Period$inboundSchema;
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const BudgetLimit$inboundSchema: z.ZodType<
|
|
46
|
+
BudgetLimit,
|
|
47
|
+
z.ZodTypeDef,
|
|
48
|
+
unknown
|
|
49
|
+
> = z.object({
|
|
50
|
+
amount: z.number(),
|
|
51
|
+
currency: Currency$inboundSchema,
|
|
52
|
+
period: Period$inboundSchema,
|
|
53
|
+
});
|
|
54
|
+
/** @internal */
|
|
55
|
+
export type BudgetLimit$Outbound = {
|
|
56
|
+
amount: number;
|
|
57
|
+
currency: string;
|
|
58
|
+
period: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const BudgetLimit$outboundSchema: z.ZodType<
|
|
63
|
+
BudgetLimit$Outbound,
|
|
64
|
+
z.ZodTypeDef,
|
|
65
|
+
BudgetLimit
|
|
66
|
+
> = z.object({
|
|
67
|
+
amount: z.number(),
|
|
68
|
+
currency: Currency$outboundSchema,
|
|
69
|
+
period: Period$outboundSchema,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export function budgetLimitToJSON(budgetLimit: BudgetLimit): string {
|
|
73
|
+
return JSON.stringify(BudgetLimit$outboundSchema.parse(budgetLimit));
|
|
74
|
+
}
|
|
75
|
+
export function budgetLimitFromJSON(
|
|
76
|
+
jsonString: string,
|
|
77
|
+
): SafeParseResult<BudgetLimit, SDKValidationError> {
|
|
78
|
+
return safeParse(
|
|
79
|
+
jsonString,
|
|
80
|
+
(x) => BudgetLimit$inboundSchema.parse(JSON.parse(x)),
|
|
81
|
+
`Failed to parse 'BudgetLimit' from JSON`,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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 EvaluatorRefExecuteOn = {
|
|
13
|
+
Input: "input",
|
|
14
|
+
Output: "output",
|
|
15
|
+
Both: "both",
|
|
16
|
+
} as const;
|
|
17
|
+
export type EvaluatorRefExecuteOn = ClosedEnum<typeof EvaluatorRefExecuteOn>;
|
|
18
|
+
|
|
19
|
+
export type EvaluatorRef = {
|
|
20
|
+
executeOn: EvaluatorRefExecuteOn;
|
|
21
|
+
id: string;
|
|
22
|
+
isGuardrail?: boolean | undefined;
|
|
23
|
+
sampleRate?: number | undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const EvaluatorRefExecuteOn$inboundSchema: z.ZodNativeEnum<
|
|
28
|
+
typeof EvaluatorRefExecuteOn
|
|
29
|
+
> = z.nativeEnum(EvaluatorRefExecuteOn);
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const EvaluatorRefExecuteOn$outboundSchema: z.ZodNativeEnum<
|
|
32
|
+
typeof EvaluatorRefExecuteOn
|
|
33
|
+
> = EvaluatorRefExecuteOn$inboundSchema;
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const EvaluatorRef$inboundSchema: z.ZodType<
|
|
37
|
+
EvaluatorRef,
|
|
38
|
+
z.ZodTypeDef,
|
|
39
|
+
unknown
|
|
40
|
+
> = z.object({
|
|
41
|
+
execute_on: EvaluatorRefExecuteOn$inboundSchema,
|
|
42
|
+
id: z.string(),
|
|
43
|
+
is_guardrail: z.boolean().optional(),
|
|
44
|
+
sample_rate: z.number().optional(),
|
|
45
|
+
}).transform((v) => {
|
|
46
|
+
return remap$(v, {
|
|
47
|
+
"execute_on": "executeOn",
|
|
48
|
+
"is_guardrail": "isGuardrail",
|
|
49
|
+
"sample_rate": "sampleRate",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
/** @internal */
|
|
53
|
+
export type EvaluatorRef$Outbound = {
|
|
54
|
+
execute_on: string;
|
|
55
|
+
id: string;
|
|
56
|
+
is_guardrail?: boolean | undefined;
|
|
57
|
+
sample_rate?: number | undefined;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const EvaluatorRef$outboundSchema: z.ZodType<
|
|
62
|
+
EvaluatorRef$Outbound,
|
|
63
|
+
z.ZodTypeDef,
|
|
64
|
+
EvaluatorRef
|
|
65
|
+
> = z.object({
|
|
66
|
+
executeOn: EvaluatorRefExecuteOn$outboundSchema,
|
|
67
|
+
id: z.string(),
|
|
68
|
+
isGuardrail: z.boolean().optional(),
|
|
69
|
+
sampleRate: z.number().optional(),
|
|
70
|
+
}).transform((v) => {
|
|
71
|
+
return remap$(v, {
|
|
72
|
+
executeOn: "execute_on",
|
|
73
|
+
isGuardrail: "is_guardrail",
|
|
74
|
+
sampleRate: "sample_rate",
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export function evaluatorRefToJSON(evaluatorRef: EvaluatorRef): string {
|
|
79
|
+
return JSON.stringify(EvaluatorRef$outboundSchema.parse(evaluatorRef));
|
|
80
|
+
}
|
|
81
|
+
export function evaluatorRefFromJSON(
|
|
82
|
+
jsonString: string,
|
|
83
|
+
): SafeParseResult<EvaluatorRef, SDKValidationError> {
|
|
84
|
+
return safeParse(
|
|
85
|
+
jsonString,
|
|
86
|
+
(x) => EvaluatorRef$inboundSchema.parse(JSON.parse(x)),
|
|
87
|
+
`Failed to parse 'EvaluatorRef' from JSON`,
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
|
|
10
|
+
export type Expression = {
|
|
11
|
+
cel: string;
|
|
12
|
+
config?: { [k: string]: any } | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const Expression$inboundSchema: z.ZodType<
|
|
17
|
+
Expression,
|
|
18
|
+
z.ZodTypeDef,
|
|
19
|
+
unknown
|
|
20
|
+
> = z.object({
|
|
21
|
+
cel: z.string(),
|
|
22
|
+
config: z.record(z.any()).optional(),
|
|
23
|
+
});
|
|
24
|
+
/** @internal */
|
|
25
|
+
export type Expression$Outbound = {
|
|
26
|
+
cel: string;
|
|
27
|
+
config?: { [k: string]: any } | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const Expression$outboundSchema: z.ZodType<
|
|
32
|
+
Expression$Outbound,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
Expression
|
|
35
|
+
> = z.object({
|
|
36
|
+
cel: z.string(),
|
|
37
|
+
config: z.record(z.any()).optional(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export function expressionToJSON(expression: Expression): string {
|
|
41
|
+
return JSON.stringify(Expression$outboundSchema.parse(expression));
|
|
42
|
+
}
|
|
43
|
+
export function expressionFromJSON(
|
|
44
|
+
jsonString: string,
|
|
45
|
+
): SafeParseResult<Expression, SDKValidationError> {
|
|
46
|
+
return safeParse(
|
|
47
|
+
jsonString,
|
|
48
|
+
(x) => Expression$inboundSchema.parse(JSON.parse(x)),
|
|
49
|
+
`Failed to parse 'Expression' from JSON`,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -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
|
+
}
|