@orq-ai/node 3.14.31 → 3.14.33
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/bin/mcp-server.js +210 -210
- package/bin/mcp-server.js.map +35 -35
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/operations/createbudget.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +8 -8
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +28 -28
- package/models/operations/createtool.js +10 -10
- package/models/operations/duplicatetool.js +10 -10
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getalltools.js +10 -10
- package/models/operations/getbudget.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/listbudgets.js +2 -2
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +8 -8
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrievedatapoint.js +8 -8
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/retrievetool.js +10 -10
- package/models/operations/updatebudget.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updatedatapoint.js +8 -8
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +28 -28
- package/models/operations/updatetool.js +10 -10
- package/package.json +1 -1
- package/packages/orq-rc/docs/sdks/agents/README.md +2 -2
- package/packages/orq-rc/examples/package-lock.json +1 -1
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +2 -2
- package/packages/orq-rc/package.json +1 -1
- package/packages/orq-rc/src/funcs/toolsDuplicate.ts +3 -2
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +1 -1
- package/packages/orq-rc/src/models/operations/createagent.ts +403 -17
- package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +8 -8
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +30 -28
- package/packages/orq-rc/src/models/operations/createtool.ts +10 -10
- package/packages/orq-rc/src/models/operations/duplicateagent.ts +206 -0
- package/packages/orq-rc/src/models/operations/duplicatetool.ts +70 -10
- package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
- package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
- package/packages/orq-rc/src/models/operations/getagent.ts +204 -0
- package/packages/orq-rc/src/models/operations/getalltools.ts +10 -10
- package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
- package/packages/orq-rc/src/models/operations/listagents.ts +204 -0
- package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +8 -8
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievetool.ts +10 -10
- package/packages/orq-rc/src/models/operations/runagent.ts +202 -0
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +204 -0
- package/packages/orq-rc/src/models/operations/updateagent.ts +415 -0
- package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +8 -8
- package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateeval.ts +30 -28
- package/packages/orq-rc/src/models/operations/updatetool.ts +10 -10
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/operations/createbudget.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +8 -8
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +28 -28
- package/src/models/operations/createtool.ts +10 -10
- package/src/models/operations/duplicatetool.ts +10 -10
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/getalltools.ts +10 -10
- package/src/models/operations/getbudget.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/listbudgets.ts +2 -2
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +8 -8
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/retrievetool.ts +10 -10
- package/src/models/operations/updatebudget.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +8 -8
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +28 -28
- package/src/models/operations/updatetool.ts +10 -10
|
@@ -145,7 +145,7 @@ export const RetrieveDatasourceResponseBody$inboundSchema: z.ZodType<
|
|
|
145
145
|
z.ZodTypeDef,
|
|
146
146
|
unknown
|
|
147
147
|
> = z.object({
|
|
148
|
-
_id: z.string().default("
|
|
148
|
+
_id: z.string().default("01K9Y89TFT967PW4EQNCK2V1S4"),
|
|
149
149
|
display_name: z.string(),
|
|
150
150
|
description: z.string().optional(),
|
|
151
151
|
status: RetrieveDatasourceStatus$inboundSchema,
|
|
@@ -188,7 +188,7 @@ export const RetrieveDatasourceResponseBody$outboundSchema: z.ZodType<
|
|
|
188
188
|
z.ZodTypeDef,
|
|
189
189
|
RetrieveDatasourceResponseBody
|
|
190
190
|
> = z.object({
|
|
191
|
-
id: z.string().default("
|
|
191
|
+
id: z.string().default("01K9Y89TFT967PW4EQNCK2V1S4"),
|
|
192
192
|
displayName: z.string(),
|
|
193
193
|
description: z.string().optional(),
|
|
194
194
|
status: RetrieveDatasourceStatus$outboundSchema,
|
|
@@ -715,7 +715,7 @@ export const RetrieveToolResponseBody5$inboundSchema: z.ZodType<
|
|
|
715
715
|
z.ZodTypeDef,
|
|
716
716
|
unknown
|
|
717
717
|
> = z.object({
|
|
718
|
-
_id: z.string().default("
|
|
718
|
+
_id: z.string().default("01K9Y89TDE89BA7VX9YEBQ3C5K"),
|
|
719
719
|
path: z.string(),
|
|
720
720
|
key: z.string(),
|
|
721
721
|
display_name: z.string().optional(),
|
|
@@ -770,7 +770,7 @@ export const RetrieveToolResponseBody5$outboundSchema: z.ZodType<
|
|
|
770
770
|
z.ZodTypeDef,
|
|
771
771
|
RetrieveToolResponseBody5
|
|
772
772
|
> = z.object({
|
|
773
|
-
id: z.string().default("
|
|
773
|
+
id: z.string().default("01K9Y89TDE89BA7VX9YEBQ3C5K"),
|
|
774
774
|
path: z.string(),
|
|
775
775
|
key: z.string(),
|
|
776
776
|
displayName: z.string().optional(),
|
|
@@ -1037,7 +1037,7 @@ export const RetrieveToolResponseBody4$inboundSchema: z.ZodType<
|
|
|
1037
1037
|
z.ZodTypeDef,
|
|
1038
1038
|
unknown
|
|
1039
1039
|
> = z.object({
|
|
1040
|
-
_id: z.string().default("
|
|
1040
|
+
_id: z.string().default("01K9Y89TDCZMTG03XKHFKN0TP0"),
|
|
1041
1041
|
path: z.string(),
|
|
1042
1042
|
key: z.string(),
|
|
1043
1043
|
display_name: z.string().optional(),
|
|
@@ -1090,7 +1090,7 @@ export const RetrieveToolResponseBody4$outboundSchema: z.ZodType<
|
|
|
1090
1090
|
z.ZodTypeDef,
|
|
1091
1091
|
RetrieveToolResponseBody4
|
|
1092
1092
|
> = z.object({
|
|
1093
|
-
id: z.string().default("
|
|
1093
|
+
id: z.string().default("01K9Y89TDCZMTG03XKHFKN0TP0"),
|
|
1094
1094
|
path: z.string(),
|
|
1095
1095
|
key: z.string(),
|
|
1096
1096
|
displayName: z.string().optional(),
|
|
@@ -1435,7 +1435,7 @@ export const RetrieveToolResponseBody3$inboundSchema: z.ZodType<
|
|
|
1435
1435
|
z.ZodTypeDef,
|
|
1436
1436
|
unknown
|
|
1437
1437
|
> = z.object({
|
|
1438
|
-
_id: z.string().default("
|
|
1438
|
+
_id: z.string().default("01K9Y89TDA7VTH86N4J92TW92D"),
|
|
1439
1439
|
path: z.string(),
|
|
1440
1440
|
key: z.string(),
|
|
1441
1441
|
display_name: z.string().optional(),
|
|
@@ -1488,7 +1488,7 @@ export const RetrieveToolResponseBody3$outboundSchema: z.ZodType<
|
|
|
1488
1488
|
z.ZodTypeDef,
|
|
1489
1489
|
RetrieveToolResponseBody3
|
|
1490
1490
|
> = z.object({
|
|
1491
|
-
id: z.string().default("
|
|
1491
|
+
id: z.string().default("01K9Y89TDA7VTH86N4J92TW92D"),
|
|
1492
1492
|
path: z.string(),
|
|
1493
1493
|
key: z.string(),
|
|
1494
1494
|
displayName: z.string().optional(),
|
|
@@ -1609,7 +1609,7 @@ export const RetrieveToolResponseBody2$inboundSchema: z.ZodType<
|
|
|
1609
1609
|
z.ZodTypeDef,
|
|
1610
1610
|
unknown
|
|
1611
1611
|
> = z.object({
|
|
1612
|
-
_id: z.string().default("
|
|
1612
|
+
_id: z.string().default("01K9Y89TD8Q3AQ6P24J1C93QYZ"),
|
|
1613
1613
|
path: z.string(),
|
|
1614
1614
|
key: z.string(),
|
|
1615
1615
|
display_name: z.string().optional(),
|
|
@@ -1661,7 +1661,7 @@ export const RetrieveToolResponseBody2$outboundSchema: z.ZodType<
|
|
|
1661
1661
|
z.ZodTypeDef,
|
|
1662
1662
|
RetrieveToolResponseBody2
|
|
1663
1663
|
> = z.object({
|
|
1664
|
-
id: z.string().default("
|
|
1664
|
+
id: z.string().default("01K9Y89TD8Q3AQ6P24J1C93QYZ"),
|
|
1665
1665
|
path: z.string(),
|
|
1666
1666
|
key: z.string(),
|
|
1667
1667
|
displayName: z.string().optional(),
|
|
@@ -1780,7 +1780,7 @@ export const RetrieveToolResponseBody1$inboundSchema: z.ZodType<
|
|
|
1780
1780
|
z.ZodTypeDef,
|
|
1781
1781
|
unknown
|
|
1782
1782
|
> = z.object({
|
|
1783
|
-
_id: z.string().default("
|
|
1783
|
+
_id: z.string().default("01K9Y89TD6C51M5B737380DE38"),
|
|
1784
1784
|
path: z.string(),
|
|
1785
1785
|
key: z.string(),
|
|
1786
1786
|
display_name: z.string().optional(),
|
|
@@ -1831,7 +1831,7 @@ export const RetrieveToolResponseBody1$outboundSchema: z.ZodType<
|
|
|
1831
1831
|
z.ZodTypeDef,
|
|
1832
1832
|
RetrieveToolResponseBody1
|
|
1833
1833
|
> = z.object({
|
|
1834
|
-
id: z.string().default("
|
|
1834
|
+
id: z.string().default("01K9Y89TD6C51M5B737380DE38"),
|
|
1835
1835
|
path: z.string(),
|
|
1836
1836
|
key: z.string(),
|
|
1837
1837
|
displayName: z.string().optional(),
|
|
@@ -1358,6 +1358,62 @@ export type RunAgentToolApprovalRequired = ClosedEnum<
|
|
|
1358
1358
|
typeof RunAgentToolApprovalRequired
|
|
1359
1359
|
>;
|
|
1360
1360
|
|
|
1361
|
+
/**
|
|
1362
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1363
|
+
*/
|
|
1364
|
+
export const RunAgentExecuteOn = {
|
|
1365
|
+
Input: "input",
|
|
1366
|
+
Output: "output",
|
|
1367
|
+
} as const;
|
|
1368
|
+
/**
|
|
1369
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1370
|
+
*/
|
|
1371
|
+
export type RunAgentExecuteOn = ClosedEnum<typeof RunAgentExecuteOn>;
|
|
1372
|
+
|
|
1373
|
+
export type RunAgentEvaluators = {
|
|
1374
|
+
/**
|
|
1375
|
+
* Unique key or identifier of the evaluator
|
|
1376
|
+
*/
|
|
1377
|
+
id: string;
|
|
1378
|
+
/**
|
|
1379
|
+
* The percentage of executions to evaluate with this evaluator (1-100). For example, a value of 50 means the evaluator will run on approximately half of the executions.
|
|
1380
|
+
*/
|
|
1381
|
+
sampleRate?: number | undefined;
|
|
1382
|
+
/**
|
|
1383
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1384
|
+
*/
|
|
1385
|
+
executeOn: RunAgentExecuteOn;
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1390
|
+
*/
|
|
1391
|
+
export const RunAgentAgentsExecuteOn = {
|
|
1392
|
+
Input: "input",
|
|
1393
|
+
Output: "output",
|
|
1394
|
+
} as const;
|
|
1395
|
+
/**
|
|
1396
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1397
|
+
*/
|
|
1398
|
+
export type RunAgentAgentsExecuteOn = ClosedEnum<
|
|
1399
|
+
typeof RunAgentAgentsExecuteOn
|
|
1400
|
+
>;
|
|
1401
|
+
|
|
1402
|
+
export type RunAgentGuardrails = {
|
|
1403
|
+
/**
|
|
1404
|
+
* Unique key or identifier of the evaluator
|
|
1405
|
+
*/
|
|
1406
|
+
id: string;
|
|
1407
|
+
/**
|
|
1408
|
+
* The percentage of executions to evaluate with this evaluator (1-100). For example, a value of 50 means the evaluator will run on approximately half of the executions.
|
|
1409
|
+
*/
|
|
1410
|
+
sampleRate?: number | undefined;
|
|
1411
|
+
/**
|
|
1412
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1413
|
+
*/
|
|
1414
|
+
executeOn: RunAgentAgentsExecuteOn;
|
|
1415
|
+
};
|
|
1416
|
+
|
|
1361
1417
|
export type RunAgentSettings = {
|
|
1362
1418
|
/**
|
|
1363
1419
|
* Tools available to the agent
|
|
@@ -1392,6 +1448,14 @@ export type RunAgentSettings = {
|
|
|
1392
1448
|
* Maximum time (in seconds) for the agent thinking process. This does not include the time for tool calls and sub agent calls. It will be loosely enforced, the in progress LLM calls will not be terminated and the last assistant message will be returned.
|
|
1393
1449
|
*/
|
|
1394
1450
|
maxExecutionTime?: number | undefined;
|
|
1451
|
+
/**
|
|
1452
|
+
* Configuration for an evaluator applied to the agent
|
|
1453
|
+
*/
|
|
1454
|
+
evaluators?: Array<RunAgentEvaluators> | undefined;
|
|
1455
|
+
/**
|
|
1456
|
+
* Configuration for a guardrail applied to the agent
|
|
1457
|
+
*/
|
|
1458
|
+
guardrails?: Array<RunAgentGuardrails> | undefined;
|
|
1395
1459
|
};
|
|
1396
1460
|
|
|
1397
1461
|
export type RunAgentRequestBody = {
|
|
@@ -5670,6 +5734,134 @@ export const RunAgentToolApprovalRequired$outboundSchema: z.ZodNativeEnum<
|
|
|
5670
5734
|
typeof RunAgentToolApprovalRequired
|
|
5671
5735
|
> = RunAgentToolApprovalRequired$inboundSchema;
|
|
5672
5736
|
|
|
5737
|
+
/** @internal */
|
|
5738
|
+
export const RunAgentExecuteOn$inboundSchema: z.ZodNativeEnum<
|
|
5739
|
+
typeof RunAgentExecuteOn
|
|
5740
|
+
> = z.nativeEnum(RunAgentExecuteOn);
|
|
5741
|
+
/** @internal */
|
|
5742
|
+
export const RunAgentExecuteOn$outboundSchema: z.ZodNativeEnum<
|
|
5743
|
+
typeof RunAgentExecuteOn
|
|
5744
|
+
> = RunAgentExecuteOn$inboundSchema;
|
|
5745
|
+
|
|
5746
|
+
/** @internal */
|
|
5747
|
+
export const RunAgentEvaluators$inboundSchema: z.ZodType<
|
|
5748
|
+
RunAgentEvaluators,
|
|
5749
|
+
z.ZodTypeDef,
|
|
5750
|
+
unknown
|
|
5751
|
+
> = z.object({
|
|
5752
|
+
id: z.string(),
|
|
5753
|
+
sample_rate: z.number().default(50),
|
|
5754
|
+
execute_on: RunAgentExecuteOn$inboundSchema,
|
|
5755
|
+
}).transform((v) => {
|
|
5756
|
+
return remap$(v, {
|
|
5757
|
+
"sample_rate": "sampleRate",
|
|
5758
|
+
"execute_on": "executeOn",
|
|
5759
|
+
});
|
|
5760
|
+
});
|
|
5761
|
+
/** @internal */
|
|
5762
|
+
export type RunAgentEvaluators$Outbound = {
|
|
5763
|
+
id: string;
|
|
5764
|
+
sample_rate: number;
|
|
5765
|
+
execute_on: string;
|
|
5766
|
+
};
|
|
5767
|
+
|
|
5768
|
+
/** @internal */
|
|
5769
|
+
export const RunAgentEvaluators$outboundSchema: z.ZodType<
|
|
5770
|
+
RunAgentEvaluators$Outbound,
|
|
5771
|
+
z.ZodTypeDef,
|
|
5772
|
+
RunAgentEvaluators
|
|
5773
|
+
> = z.object({
|
|
5774
|
+
id: z.string(),
|
|
5775
|
+
sampleRate: z.number().default(50),
|
|
5776
|
+
executeOn: RunAgentExecuteOn$outboundSchema,
|
|
5777
|
+
}).transform((v) => {
|
|
5778
|
+
return remap$(v, {
|
|
5779
|
+
sampleRate: "sample_rate",
|
|
5780
|
+
executeOn: "execute_on",
|
|
5781
|
+
});
|
|
5782
|
+
});
|
|
5783
|
+
|
|
5784
|
+
export function runAgentEvaluatorsToJSON(
|
|
5785
|
+
runAgentEvaluators: RunAgentEvaluators,
|
|
5786
|
+
): string {
|
|
5787
|
+
return JSON.stringify(
|
|
5788
|
+
RunAgentEvaluators$outboundSchema.parse(runAgentEvaluators),
|
|
5789
|
+
);
|
|
5790
|
+
}
|
|
5791
|
+
export function runAgentEvaluatorsFromJSON(
|
|
5792
|
+
jsonString: string,
|
|
5793
|
+
): SafeParseResult<RunAgentEvaluators, SDKValidationError> {
|
|
5794
|
+
return safeParse(
|
|
5795
|
+
jsonString,
|
|
5796
|
+
(x) => RunAgentEvaluators$inboundSchema.parse(JSON.parse(x)),
|
|
5797
|
+
`Failed to parse 'RunAgentEvaluators' from JSON`,
|
|
5798
|
+
);
|
|
5799
|
+
}
|
|
5800
|
+
|
|
5801
|
+
/** @internal */
|
|
5802
|
+
export const RunAgentAgentsExecuteOn$inboundSchema: z.ZodNativeEnum<
|
|
5803
|
+
typeof RunAgentAgentsExecuteOn
|
|
5804
|
+
> = z.nativeEnum(RunAgentAgentsExecuteOn);
|
|
5805
|
+
/** @internal */
|
|
5806
|
+
export const RunAgentAgentsExecuteOn$outboundSchema: z.ZodNativeEnum<
|
|
5807
|
+
typeof RunAgentAgentsExecuteOn
|
|
5808
|
+
> = RunAgentAgentsExecuteOn$inboundSchema;
|
|
5809
|
+
|
|
5810
|
+
/** @internal */
|
|
5811
|
+
export const RunAgentGuardrails$inboundSchema: z.ZodType<
|
|
5812
|
+
RunAgentGuardrails,
|
|
5813
|
+
z.ZodTypeDef,
|
|
5814
|
+
unknown
|
|
5815
|
+
> = z.object({
|
|
5816
|
+
id: z.string(),
|
|
5817
|
+
sample_rate: z.number().default(50),
|
|
5818
|
+
execute_on: RunAgentAgentsExecuteOn$inboundSchema,
|
|
5819
|
+
}).transform((v) => {
|
|
5820
|
+
return remap$(v, {
|
|
5821
|
+
"sample_rate": "sampleRate",
|
|
5822
|
+
"execute_on": "executeOn",
|
|
5823
|
+
});
|
|
5824
|
+
});
|
|
5825
|
+
/** @internal */
|
|
5826
|
+
export type RunAgentGuardrails$Outbound = {
|
|
5827
|
+
id: string;
|
|
5828
|
+
sample_rate: number;
|
|
5829
|
+
execute_on: string;
|
|
5830
|
+
};
|
|
5831
|
+
|
|
5832
|
+
/** @internal */
|
|
5833
|
+
export const RunAgentGuardrails$outboundSchema: z.ZodType<
|
|
5834
|
+
RunAgentGuardrails$Outbound,
|
|
5835
|
+
z.ZodTypeDef,
|
|
5836
|
+
RunAgentGuardrails
|
|
5837
|
+
> = z.object({
|
|
5838
|
+
id: z.string(),
|
|
5839
|
+
sampleRate: z.number().default(50),
|
|
5840
|
+
executeOn: RunAgentAgentsExecuteOn$outboundSchema,
|
|
5841
|
+
}).transform((v) => {
|
|
5842
|
+
return remap$(v, {
|
|
5843
|
+
sampleRate: "sample_rate",
|
|
5844
|
+
executeOn: "execute_on",
|
|
5845
|
+
});
|
|
5846
|
+
});
|
|
5847
|
+
|
|
5848
|
+
export function runAgentGuardrailsToJSON(
|
|
5849
|
+
runAgentGuardrails: RunAgentGuardrails,
|
|
5850
|
+
): string {
|
|
5851
|
+
return JSON.stringify(
|
|
5852
|
+
RunAgentGuardrails$outboundSchema.parse(runAgentGuardrails),
|
|
5853
|
+
);
|
|
5854
|
+
}
|
|
5855
|
+
export function runAgentGuardrailsFromJSON(
|
|
5856
|
+
jsonString: string,
|
|
5857
|
+
): SafeParseResult<RunAgentGuardrails, SDKValidationError> {
|
|
5858
|
+
return safeParse(
|
|
5859
|
+
jsonString,
|
|
5860
|
+
(x) => RunAgentGuardrails$inboundSchema.parse(JSON.parse(x)),
|
|
5861
|
+
`Failed to parse 'RunAgentGuardrails' from JSON`,
|
|
5862
|
+
);
|
|
5863
|
+
}
|
|
5864
|
+
|
|
5673
5865
|
/** @internal */
|
|
5674
5866
|
export const RunAgentSettings$inboundSchema: z.ZodType<
|
|
5675
5867
|
RunAgentSettings,
|
|
@@ -5699,6 +5891,10 @@ export const RunAgentSettings$inboundSchema: z.ZodType<
|
|
|
5699
5891
|
),
|
|
5700
5892
|
max_iterations: z.number().int().default(15),
|
|
5701
5893
|
max_execution_time: z.number().int().default(300),
|
|
5894
|
+
evaluators: z.array(z.lazy(() => RunAgentEvaluators$inboundSchema))
|
|
5895
|
+
.optional(),
|
|
5896
|
+
guardrails: z.array(z.lazy(() => RunAgentGuardrails$inboundSchema))
|
|
5897
|
+
.optional(),
|
|
5702
5898
|
}).transform((v) => {
|
|
5703
5899
|
return remap$(v, {
|
|
5704
5900
|
"tool_approval_required": "toolApprovalRequired",
|
|
@@ -5729,6 +5925,8 @@ export type RunAgentSettings$Outbound = {
|
|
|
5729
5925
|
tool_approval_required: string;
|
|
5730
5926
|
max_iterations: number;
|
|
5731
5927
|
max_execution_time: number;
|
|
5928
|
+
evaluators?: Array<RunAgentEvaluators$Outbound> | undefined;
|
|
5929
|
+
guardrails?: Array<RunAgentGuardrails$Outbound> | undefined;
|
|
5732
5930
|
};
|
|
5733
5931
|
|
|
5734
5932
|
/** @internal */
|
|
@@ -5760,6 +5958,10 @@ export const RunAgentSettings$outboundSchema: z.ZodType<
|
|
|
5760
5958
|
),
|
|
5761
5959
|
maxIterations: z.number().int().default(15),
|
|
5762
5960
|
maxExecutionTime: z.number().int().default(300),
|
|
5961
|
+
evaluators: z.array(z.lazy(() => RunAgentEvaluators$outboundSchema))
|
|
5962
|
+
.optional(),
|
|
5963
|
+
guardrails: z.array(z.lazy(() => RunAgentGuardrails$outboundSchema))
|
|
5964
|
+
.optional(),
|
|
5763
5965
|
}).transform((v) => {
|
|
5764
5966
|
return remap$(v, {
|
|
5765
5967
|
toolApprovalRequired: "tool_approval_required",
|
|
@@ -1395,6 +1395,64 @@ export type StreamRunAgentToolApprovalRequired = ClosedEnum<
|
|
|
1395
1395
|
typeof StreamRunAgentToolApprovalRequired
|
|
1396
1396
|
>;
|
|
1397
1397
|
|
|
1398
|
+
/**
|
|
1399
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1400
|
+
*/
|
|
1401
|
+
export const StreamRunAgentExecuteOn = {
|
|
1402
|
+
Input: "input",
|
|
1403
|
+
Output: "output",
|
|
1404
|
+
} as const;
|
|
1405
|
+
/**
|
|
1406
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1407
|
+
*/
|
|
1408
|
+
export type StreamRunAgentExecuteOn = ClosedEnum<
|
|
1409
|
+
typeof StreamRunAgentExecuteOn
|
|
1410
|
+
>;
|
|
1411
|
+
|
|
1412
|
+
export type StreamRunAgentEvaluators = {
|
|
1413
|
+
/**
|
|
1414
|
+
* Unique key or identifier of the evaluator
|
|
1415
|
+
*/
|
|
1416
|
+
id: string;
|
|
1417
|
+
/**
|
|
1418
|
+
* The percentage of executions to evaluate with this evaluator (1-100). For example, a value of 50 means the evaluator will run on approximately half of the executions.
|
|
1419
|
+
*/
|
|
1420
|
+
sampleRate?: number | undefined;
|
|
1421
|
+
/**
|
|
1422
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1423
|
+
*/
|
|
1424
|
+
executeOn: StreamRunAgentExecuteOn;
|
|
1425
|
+
};
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1429
|
+
*/
|
|
1430
|
+
export const StreamRunAgentAgentsExecuteOn = {
|
|
1431
|
+
Input: "input",
|
|
1432
|
+
Output: "output",
|
|
1433
|
+
} as const;
|
|
1434
|
+
/**
|
|
1435
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1436
|
+
*/
|
|
1437
|
+
export type StreamRunAgentAgentsExecuteOn = ClosedEnum<
|
|
1438
|
+
typeof StreamRunAgentAgentsExecuteOn
|
|
1439
|
+
>;
|
|
1440
|
+
|
|
1441
|
+
export type StreamRunAgentGuardrails = {
|
|
1442
|
+
/**
|
|
1443
|
+
* Unique key or identifier of the evaluator
|
|
1444
|
+
*/
|
|
1445
|
+
id: string;
|
|
1446
|
+
/**
|
|
1447
|
+
* The percentage of executions to evaluate with this evaluator (1-100). For example, a value of 50 means the evaluator will run on approximately half of the executions.
|
|
1448
|
+
*/
|
|
1449
|
+
sampleRate?: number | undefined;
|
|
1450
|
+
/**
|
|
1451
|
+
* Determines whether the evaluator runs on the agent input (user message) or output (agent response).
|
|
1452
|
+
*/
|
|
1453
|
+
executeOn: StreamRunAgentAgentsExecuteOn;
|
|
1454
|
+
};
|
|
1455
|
+
|
|
1398
1456
|
export type StreamRunAgentSettings = {
|
|
1399
1457
|
/**
|
|
1400
1458
|
* Tools available to the agent
|
|
@@ -1429,6 +1487,14 @@ export type StreamRunAgentSettings = {
|
|
|
1429
1487
|
* Maximum time (in seconds) for the agent thinking process. This does not include the time for tool calls and sub agent calls. It will be loosely enforced, the in progress LLM calls will not be terminated and the last assistant message will be returned.
|
|
1430
1488
|
*/
|
|
1431
1489
|
maxExecutionTime?: number | undefined;
|
|
1490
|
+
/**
|
|
1491
|
+
* Configuration for an evaluator applied to the agent
|
|
1492
|
+
*/
|
|
1493
|
+
evaluators?: Array<StreamRunAgentEvaluators> | undefined;
|
|
1494
|
+
/**
|
|
1495
|
+
* Configuration for a guardrail applied to the agent
|
|
1496
|
+
*/
|
|
1497
|
+
guardrails?: Array<StreamRunAgentGuardrails> | undefined;
|
|
1432
1498
|
};
|
|
1433
1499
|
|
|
1434
1500
|
export type StreamRunAgentRequestBody = {
|
|
@@ -5825,6 +5891,134 @@ export const StreamRunAgentToolApprovalRequired$outboundSchema: z.ZodNativeEnum<
|
|
|
5825
5891
|
typeof StreamRunAgentToolApprovalRequired
|
|
5826
5892
|
> = StreamRunAgentToolApprovalRequired$inboundSchema;
|
|
5827
5893
|
|
|
5894
|
+
/** @internal */
|
|
5895
|
+
export const StreamRunAgentExecuteOn$inboundSchema: z.ZodNativeEnum<
|
|
5896
|
+
typeof StreamRunAgentExecuteOn
|
|
5897
|
+
> = z.nativeEnum(StreamRunAgentExecuteOn);
|
|
5898
|
+
/** @internal */
|
|
5899
|
+
export const StreamRunAgentExecuteOn$outboundSchema: z.ZodNativeEnum<
|
|
5900
|
+
typeof StreamRunAgentExecuteOn
|
|
5901
|
+
> = StreamRunAgentExecuteOn$inboundSchema;
|
|
5902
|
+
|
|
5903
|
+
/** @internal */
|
|
5904
|
+
export const StreamRunAgentEvaluators$inboundSchema: z.ZodType<
|
|
5905
|
+
StreamRunAgentEvaluators,
|
|
5906
|
+
z.ZodTypeDef,
|
|
5907
|
+
unknown
|
|
5908
|
+
> = z.object({
|
|
5909
|
+
id: z.string(),
|
|
5910
|
+
sample_rate: z.number().default(50),
|
|
5911
|
+
execute_on: StreamRunAgentExecuteOn$inboundSchema,
|
|
5912
|
+
}).transform((v) => {
|
|
5913
|
+
return remap$(v, {
|
|
5914
|
+
"sample_rate": "sampleRate",
|
|
5915
|
+
"execute_on": "executeOn",
|
|
5916
|
+
});
|
|
5917
|
+
});
|
|
5918
|
+
/** @internal */
|
|
5919
|
+
export type StreamRunAgentEvaluators$Outbound = {
|
|
5920
|
+
id: string;
|
|
5921
|
+
sample_rate: number;
|
|
5922
|
+
execute_on: string;
|
|
5923
|
+
};
|
|
5924
|
+
|
|
5925
|
+
/** @internal */
|
|
5926
|
+
export const StreamRunAgentEvaluators$outboundSchema: z.ZodType<
|
|
5927
|
+
StreamRunAgentEvaluators$Outbound,
|
|
5928
|
+
z.ZodTypeDef,
|
|
5929
|
+
StreamRunAgentEvaluators
|
|
5930
|
+
> = z.object({
|
|
5931
|
+
id: z.string(),
|
|
5932
|
+
sampleRate: z.number().default(50),
|
|
5933
|
+
executeOn: StreamRunAgentExecuteOn$outboundSchema,
|
|
5934
|
+
}).transform((v) => {
|
|
5935
|
+
return remap$(v, {
|
|
5936
|
+
sampleRate: "sample_rate",
|
|
5937
|
+
executeOn: "execute_on",
|
|
5938
|
+
});
|
|
5939
|
+
});
|
|
5940
|
+
|
|
5941
|
+
export function streamRunAgentEvaluatorsToJSON(
|
|
5942
|
+
streamRunAgentEvaluators: StreamRunAgentEvaluators,
|
|
5943
|
+
): string {
|
|
5944
|
+
return JSON.stringify(
|
|
5945
|
+
StreamRunAgentEvaluators$outboundSchema.parse(streamRunAgentEvaluators),
|
|
5946
|
+
);
|
|
5947
|
+
}
|
|
5948
|
+
export function streamRunAgentEvaluatorsFromJSON(
|
|
5949
|
+
jsonString: string,
|
|
5950
|
+
): SafeParseResult<StreamRunAgentEvaluators, SDKValidationError> {
|
|
5951
|
+
return safeParse(
|
|
5952
|
+
jsonString,
|
|
5953
|
+
(x) => StreamRunAgentEvaluators$inboundSchema.parse(JSON.parse(x)),
|
|
5954
|
+
`Failed to parse 'StreamRunAgentEvaluators' from JSON`,
|
|
5955
|
+
);
|
|
5956
|
+
}
|
|
5957
|
+
|
|
5958
|
+
/** @internal */
|
|
5959
|
+
export const StreamRunAgentAgentsExecuteOn$inboundSchema: z.ZodNativeEnum<
|
|
5960
|
+
typeof StreamRunAgentAgentsExecuteOn
|
|
5961
|
+
> = z.nativeEnum(StreamRunAgentAgentsExecuteOn);
|
|
5962
|
+
/** @internal */
|
|
5963
|
+
export const StreamRunAgentAgentsExecuteOn$outboundSchema: z.ZodNativeEnum<
|
|
5964
|
+
typeof StreamRunAgentAgentsExecuteOn
|
|
5965
|
+
> = StreamRunAgentAgentsExecuteOn$inboundSchema;
|
|
5966
|
+
|
|
5967
|
+
/** @internal */
|
|
5968
|
+
export const StreamRunAgentGuardrails$inboundSchema: z.ZodType<
|
|
5969
|
+
StreamRunAgentGuardrails,
|
|
5970
|
+
z.ZodTypeDef,
|
|
5971
|
+
unknown
|
|
5972
|
+
> = z.object({
|
|
5973
|
+
id: z.string(),
|
|
5974
|
+
sample_rate: z.number().default(50),
|
|
5975
|
+
execute_on: StreamRunAgentAgentsExecuteOn$inboundSchema,
|
|
5976
|
+
}).transform((v) => {
|
|
5977
|
+
return remap$(v, {
|
|
5978
|
+
"sample_rate": "sampleRate",
|
|
5979
|
+
"execute_on": "executeOn",
|
|
5980
|
+
});
|
|
5981
|
+
});
|
|
5982
|
+
/** @internal */
|
|
5983
|
+
export type StreamRunAgentGuardrails$Outbound = {
|
|
5984
|
+
id: string;
|
|
5985
|
+
sample_rate: number;
|
|
5986
|
+
execute_on: string;
|
|
5987
|
+
};
|
|
5988
|
+
|
|
5989
|
+
/** @internal */
|
|
5990
|
+
export const StreamRunAgentGuardrails$outboundSchema: z.ZodType<
|
|
5991
|
+
StreamRunAgentGuardrails$Outbound,
|
|
5992
|
+
z.ZodTypeDef,
|
|
5993
|
+
StreamRunAgentGuardrails
|
|
5994
|
+
> = z.object({
|
|
5995
|
+
id: z.string(),
|
|
5996
|
+
sampleRate: z.number().default(50),
|
|
5997
|
+
executeOn: StreamRunAgentAgentsExecuteOn$outboundSchema,
|
|
5998
|
+
}).transform((v) => {
|
|
5999
|
+
return remap$(v, {
|
|
6000
|
+
sampleRate: "sample_rate",
|
|
6001
|
+
executeOn: "execute_on",
|
|
6002
|
+
});
|
|
6003
|
+
});
|
|
6004
|
+
|
|
6005
|
+
export function streamRunAgentGuardrailsToJSON(
|
|
6006
|
+
streamRunAgentGuardrails: StreamRunAgentGuardrails,
|
|
6007
|
+
): string {
|
|
6008
|
+
return JSON.stringify(
|
|
6009
|
+
StreamRunAgentGuardrails$outboundSchema.parse(streamRunAgentGuardrails),
|
|
6010
|
+
);
|
|
6011
|
+
}
|
|
6012
|
+
export function streamRunAgentGuardrailsFromJSON(
|
|
6013
|
+
jsonString: string,
|
|
6014
|
+
): SafeParseResult<StreamRunAgentGuardrails, SDKValidationError> {
|
|
6015
|
+
return safeParse(
|
|
6016
|
+
jsonString,
|
|
6017
|
+
(x) => StreamRunAgentGuardrails$inboundSchema.parse(JSON.parse(x)),
|
|
6018
|
+
`Failed to parse 'StreamRunAgentGuardrails' from JSON`,
|
|
6019
|
+
);
|
|
6020
|
+
}
|
|
6021
|
+
|
|
5828
6022
|
/** @internal */
|
|
5829
6023
|
export const StreamRunAgentSettings$inboundSchema: z.ZodType<
|
|
5830
6024
|
StreamRunAgentSettings,
|
|
@@ -5875,6 +6069,10 @@ export const StreamRunAgentSettings$inboundSchema: z.ZodType<
|
|
|
5875
6069
|
.default("none"),
|
|
5876
6070
|
max_iterations: z.number().int().default(15),
|
|
5877
6071
|
max_execution_time: z.number().int().default(300),
|
|
6072
|
+
evaluators: z.array(z.lazy(() => StreamRunAgentEvaluators$inboundSchema))
|
|
6073
|
+
.optional(),
|
|
6074
|
+
guardrails: z.array(z.lazy(() => StreamRunAgentGuardrails$inboundSchema))
|
|
6075
|
+
.optional(),
|
|
5878
6076
|
}).transform((v) => {
|
|
5879
6077
|
return remap$(v, {
|
|
5880
6078
|
"tool_approval_required": "toolApprovalRequired",
|
|
@@ -5905,6 +6103,8 @@ export type StreamRunAgentSettings$Outbound = {
|
|
|
5905
6103
|
tool_approval_required: string;
|
|
5906
6104
|
max_iterations: number;
|
|
5907
6105
|
max_execution_time: number;
|
|
6106
|
+
evaluators?: Array<StreamRunAgentEvaluators$Outbound> | undefined;
|
|
6107
|
+
guardrails?: Array<StreamRunAgentGuardrails$Outbound> | undefined;
|
|
5908
6108
|
};
|
|
5909
6109
|
|
|
5910
6110
|
/** @internal */
|
|
@@ -5957,6 +6157,10 @@ export const StreamRunAgentSettings$outboundSchema: z.ZodType<
|
|
|
5957
6157
|
.default("none"),
|
|
5958
6158
|
maxIterations: z.number().int().default(15),
|
|
5959
6159
|
maxExecutionTime: z.number().int().default(300),
|
|
6160
|
+
evaluators: z.array(z.lazy(() => StreamRunAgentEvaluators$outboundSchema))
|
|
6161
|
+
.optional(),
|
|
6162
|
+
guardrails: z.array(z.lazy(() => StreamRunAgentGuardrails$outboundSchema))
|
|
6163
|
+
.optional(),
|
|
5960
6164
|
}).transform((v) => {
|
|
5961
6165
|
return remap$(v, {
|
|
5962
6166
|
toolApprovalRequired: "tool_approval_required",
|