@memberjunction/core-entities 2.62.0 → 2.63.1
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.
|
@@ -7245,6 +7245,17 @@ exports.AIAgentRunSchema = zod_1.z.object({
|
|
|
7245
7245
|
* * Display Name: Message
|
|
7246
7246
|
* * SQL Data Type: nvarchar(MAX)
|
|
7247
7247
|
* * Description: Final message from the agent to the end user at the end of a run`),
|
|
7248
|
+
LastRunID: zod_1.z.string().nullable().describe(`
|
|
7249
|
+
* * Field Name: LastRunID
|
|
7250
|
+
* * Display Name: Last Run ID
|
|
7251
|
+
* * SQL Data Type: uniqueidentifier
|
|
7252
|
+
* * Related Entity/Foreign Key: MJ: AI Agent Runs (vwAIAgentRuns.ID)
|
|
7253
|
+
* * Description: Links to the previous run in a chain. Different from ParentRunID which is for sub-agent hierarchy.`),
|
|
7254
|
+
StartingPayload: zod_1.z.string().nullable().describe(`
|
|
7255
|
+
* * Field Name: StartingPayload
|
|
7256
|
+
* * Display Name: Starting Payload
|
|
7257
|
+
* * SQL Data Type: nvarchar(MAX)
|
|
7258
|
+
* * Description: The initial payload provided at the start of this run. Can be populated from the FinalPayload of the LastRun.`),
|
|
7248
7259
|
Agent: zod_1.z.string().nullable().describe(`
|
|
7249
7260
|
* * Field Name: Agent
|
|
7250
7261
|
* * Display Name: Agent
|
|
@@ -15406,14 +15417,14 @@ let AIPromptEntity = class AIPromptEntity extends core_1.BaseEntity {
|
|
|
15406
15417
|
* Validate() method override for AI Prompts entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
|
|
15407
15418
|
* * CacheSimilarityThreshold: This rule ensures that if a cache similarity threshold is provided, it must be a value between 0 and 1, inclusive. If no value is provided, that's also allowed.
|
|
15408
15419
|
* * CacheTTLSeconds: This rule ensures that if the cache expiration time in seconds is provided, it must be greater than zero.
|
|
15420
|
+
* * FailoverStrategy: This rule ensures that the FailoverStrategy field, if specified, must be either 'None', 'PowerRank', 'NextBestModel', 'SameModelDifferentVendor', or left blank (unset).
|
|
15421
|
+
* * FailoverModelStrategy: This rule ensures that the value for FailoverModelStrategy is either 'RequireSameModel', 'PreferDifferentModel', 'PreferSameModel', or left blank (not set). Any other value is not allowed.
|
|
15422
|
+
* * FailoverErrorScope: This rule ensures that the FailoverErrorScope field can only be set to 'ServiceErrorOnly', 'RateLimitOnly', 'NetworkOnly', 'All', or left empty.
|
|
15409
15423
|
* * Table-Level: This rule ensures that the ResultSelectorPromptID field must be different from the ID field. In other words, a result selector prompt cannot reference itself.
|
|
15410
15424
|
* * Table-Level: This rule ensures that if the cache match type is set to 'Vector', the cache similarity threshold must be specified. If the match type is anything other than 'Vector', the similarity threshold can be left empty.
|
|
15411
15425
|
* * Table-Level: This rule ensures that if the parallelization mode is set to 'StaticCount', then the number of parallel tasks (ParallelCount) must be provided.
|
|
15412
15426
|
* * Table-Level: This rule ensures that if the Parallelization Mode is set to 'ConfigParam', then the Parallel Config Param field must be filled in. For any other mode, the Parallel Config Param can be left empty.
|
|
15413
15427
|
* * Table-Level: This rule ensures that if the OutputType is set to 'object', an OutputExample must be provided. If the OutputType is anything other than 'object', providing an OutputExample is not required.
|
|
15414
|
-
* * FailoverErrorScope: This rule ensures that the FailoverErrorScope field can only be set to 'ServiceErrorOnly', 'RateLimitOnly', 'NetworkOnly', 'All', or left empty.
|
|
15415
|
-
* * FailoverStrategy: This rule ensures that the FailoverStrategy field, if specified, must be either 'None', 'PowerRank', 'NextBestModel', 'SameModelDifferentVendor', or left blank (unset).
|
|
15416
|
-
* * FailoverModelStrategy: This rule ensures that the value for FailoverModelStrategy is either 'RequireSameModel', 'PreferDifferentModel', 'PreferSameModel', or left blank (not set). Any other value is not allowed.
|
|
15417
15428
|
* @public
|
|
15418
15429
|
* @method
|
|
15419
15430
|
* @override
|
|
@@ -15422,14 +15433,14 @@ let AIPromptEntity = class AIPromptEntity extends core_1.BaseEntity {
|
|
|
15422
15433
|
const result = super.Validate();
|
|
15423
15434
|
this.ValidateCacheSimilarityThresholdIsBetweenZeroAndOne(result);
|
|
15424
15435
|
this.ValidateCacheTTLSecondsGreaterThanZero(result);
|
|
15436
|
+
this.ValidateFailoverStrategyAllowedValues(result);
|
|
15437
|
+
this.ValidateFailoverModelStrategyAgainstAllowedValues(result);
|
|
15438
|
+
this.ValidateFailoverErrorScopeAgainstAllowedValues(result);
|
|
15425
15439
|
this.ValidateResultSelectorPromptIDNotEqualID(result);
|
|
15426
15440
|
this.ValidateCacheSimilarityThresholdRequiredForVectorCache(result);
|
|
15427
15441
|
this.ValidateParallelCountWhenParallelizationModeIsStaticCount(result);
|
|
15428
15442
|
this.ValidateParallelConfigParamRequiredForConfigParamMode(result);
|
|
15429
15443
|
this.ValidateOutputExampleWhenOutputTypeObject(result);
|
|
15430
|
-
this.ValidateFailoverErrorScopeAgainstAllowedValues(result);
|
|
15431
|
-
this.ValidateFailoverStrategyAllowedValues(result);
|
|
15432
|
-
this.ValidateFailoverModelStrategyAgainstAllowedValues(result);
|
|
15433
15444
|
return result;
|
|
15434
15445
|
}
|
|
15435
15446
|
/**
|
|
@@ -15455,102 +15466,102 @@ let AIPromptEntity = class AIPromptEntity extends core_1.BaseEntity {
|
|
|
15455
15466
|
}
|
|
15456
15467
|
}
|
|
15457
15468
|
/**
|
|
15458
|
-
* This rule ensures that the
|
|
15469
|
+
* This rule ensures that the FailoverStrategy field, if specified, must be either 'None', 'PowerRank', 'NextBestModel', 'SameModelDifferentVendor', or left blank (unset).
|
|
15459
15470
|
* @param result - the ValidationResult object to add any errors or warnings to
|
|
15460
15471
|
* @public
|
|
15461
15472
|
* @method
|
|
15462
15473
|
*/
|
|
15463
|
-
|
|
15464
|
-
|
|
15465
|
-
|
|
15474
|
+
ValidateFailoverStrategyAllowedValues(result) {
|
|
15475
|
+
const allowed = [
|
|
15476
|
+
"None",
|
|
15477
|
+
"PowerRank",
|
|
15478
|
+
"NextBestModel",
|
|
15479
|
+
"SameModelDifferentVendor",
|
|
15480
|
+
null, // Allowing null/undefined as valid per the constraint
|
|
15481
|
+
undefined
|
|
15482
|
+
];
|
|
15483
|
+
if (!allowed.includes(this.FailoverStrategy)) {
|
|
15484
|
+
result.Errors.push(new core_1.ValidationErrorInfo("FailoverStrategy", "The failover strategy must be 'None', 'PowerRank', 'NextBestModel', 'SameModelDifferentVendor', or left blank.", this.FailoverStrategy, core_1.ValidationErrorType.Failure));
|
|
15466
15485
|
}
|
|
15467
15486
|
}
|
|
15468
15487
|
/**
|
|
15469
|
-
* This rule ensures that
|
|
15488
|
+
* This rule ensures that the value for FailoverModelStrategy is either 'RequireSameModel', 'PreferDifferentModel', 'PreferSameModel', or left blank (not set). Any other value is not allowed.
|
|
15470
15489
|
* @param result - the ValidationResult object to add any errors or warnings to
|
|
15471
15490
|
* @public
|
|
15472
15491
|
* @method
|
|
15473
15492
|
*/
|
|
15474
|
-
|
|
15475
|
-
|
|
15476
|
-
|
|
15493
|
+
ValidateFailoverModelStrategyAgainstAllowedValues(result) {
|
|
15494
|
+
const allowedValues = ["RequireSameModel", "PreferDifferentModel", "PreferSameModel", null];
|
|
15495
|
+
if (this.FailoverModelStrategy !== null &&
|
|
15496
|
+
!allowedValues.includes(this.FailoverModelStrategy)) {
|
|
15497
|
+
result.Errors.push(new core_1.ValidationErrorInfo("FailoverModelStrategy", "FailoverModelStrategy must be null or one of: 'RequireSameModel', 'PreferDifferentModel', 'PreferSameModel'.", this.FailoverModelStrategy, core_1.ValidationErrorType.Failure));
|
|
15477
15498
|
}
|
|
15478
15499
|
}
|
|
15479
15500
|
/**
|
|
15480
|
-
* This rule ensures that
|
|
15501
|
+
* This rule ensures that the FailoverErrorScope field can only be set to 'ServiceErrorOnly', 'RateLimitOnly', 'NetworkOnly', 'All', or left empty.
|
|
15481
15502
|
* @param result - the ValidationResult object to add any errors or warnings to
|
|
15482
15503
|
* @public
|
|
15483
15504
|
* @method
|
|
15484
15505
|
*/
|
|
15485
|
-
|
|
15486
|
-
|
|
15487
|
-
|
|
15506
|
+
ValidateFailoverErrorScopeAgainstAllowedValues(result) {
|
|
15507
|
+
const allowedValues = ["ServiceErrorOnly", "RateLimitOnly", "NetworkOnly", "All", null];
|
|
15508
|
+
if (!allowedValues.includes(this.FailoverErrorScope)) {
|
|
15509
|
+
result.Errors.push(new core_1.ValidationErrorInfo("FailoverErrorScope", "The failover error scope must be one of: 'ServiceErrorOnly', 'RateLimitOnly', 'NetworkOnly', 'All', or left empty.", this.FailoverErrorScope, core_1.ValidationErrorType.Failure));
|
|
15488
15510
|
}
|
|
15489
15511
|
}
|
|
15490
15512
|
/**
|
|
15491
|
-
* This rule ensures that
|
|
15513
|
+
* This rule ensures that the ResultSelectorPromptID field must be different from the ID field. In other words, a result selector prompt cannot reference itself.
|
|
15492
15514
|
* @param result - the ValidationResult object to add any errors or warnings to
|
|
15493
15515
|
* @public
|
|
15494
15516
|
* @method
|
|
15495
15517
|
*/
|
|
15496
|
-
|
|
15497
|
-
if (this.
|
|
15498
|
-
result.Errors.push(new core_1.ValidationErrorInfo("
|
|
15518
|
+
ValidateResultSelectorPromptIDNotEqualID(result) {
|
|
15519
|
+
if (this.ResultSelectorPromptID === this.ID) {
|
|
15520
|
+
result.Errors.push(new core_1.ValidationErrorInfo("ResultSelectorPromptID", "The ResultSelectorPromptID cannot be the same as the ID. A result selector prompt cannot reference itself.", this.ResultSelectorPromptID, core_1.ValidationErrorType.Failure));
|
|
15499
15521
|
}
|
|
15500
15522
|
}
|
|
15501
15523
|
/**
|
|
15502
|
-
* This rule ensures that if the
|
|
15524
|
+
* This rule ensures that if the cache match type is set to 'Vector', the cache similarity threshold must be specified. If the match type is anything other than 'Vector', the similarity threshold can be left empty.
|
|
15503
15525
|
* @param result - the ValidationResult object to add any errors or warnings to
|
|
15504
15526
|
* @public
|
|
15505
15527
|
* @method
|
|
15506
15528
|
*/
|
|
15507
|
-
|
|
15508
|
-
if (this.
|
|
15509
|
-
result.Errors.push(new core_1.ValidationErrorInfo("
|
|
15529
|
+
ValidateCacheSimilarityThresholdRequiredForVectorCache(result) {
|
|
15530
|
+
if (this.CacheMatchType === "Vector" && this.CacheSimilarityThreshold === null) {
|
|
15531
|
+
result.Errors.push(new core_1.ValidationErrorInfo("CacheSimilarityThreshold", "CacheSimilarityThreshold must be specified when CacheMatchType is 'Vector'.", this.CacheSimilarityThreshold, core_1.ValidationErrorType.Failure));
|
|
15510
15532
|
}
|
|
15511
15533
|
}
|
|
15512
15534
|
/**
|
|
15513
|
-
* This rule ensures that the
|
|
15535
|
+
* This rule ensures that if the parallelization mode is set to 'StaticCount', then the number of parallel tasks (ParallelCount) must be provided.
|
|
15514
15536
|
* @param result - the ValidationResult object to add any errors or warnings to
|
|
15515
15537
|
* @public
|
|
15516
15538
|
* @method
|
|
15517
15539
|
*/
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
|
|
15521
|
-
result.Errors.push(new core_1.ValidationErrorInfo("FailoverErrorScope", "The failover error scope must be one of: 'ServiceErrorOnly', 'RateLimitOnly', 'NetworkOnly', 'All', or left empty.", this.FailoverErrorScope, core_1.ValidationErrorType.Failure));
|
|
15540
|
+
ValidateParallelCountWhenParallelizationModeIsStaticCount(result) {
|
|
15541
|
+
if (this.ParallelizationMode === "StaticCount" && this.ParallelCount === null) {
|
|
15542
|
+
result.Errors.push(new core_1.ValidationErrorInfo("ParallelCount", "When ParallelizationMode is 'StaticCount', ParallelCount must be specified.", this.ParallelCount, core_1.ValidationErrorType.Failure));
|
|
15522
15543
|
}
|
|
15523
15544
|
}
|
|
15524
15545
|
/**
|
|
15525
|
-
* This rule ensures that the
|
|
15546
|
+
* This rule ensures that if the Parallelization Mode is set to 'ConfigParam', then the Parallel Config Param field must be filled in. For any other mode, the Parallel Config Param can be left empty.
|
|
15526
15547
|
* @param result - the ValidationResult object to add any errors or warnings to
|
|
15527
15548
|
* @public
|
|
15528
15549
|
* @method
|
|
15529
15550
|
*/
|
|
15530
|
-
|
|
15531
|
-
|
|
15532
|
-
"
|
|
15533
|
-
"PowerRank",
|
|
15534
|
-
"NextBestModel",
|
|
15535
|
-
"SameModelDifferentVendor",
|
|
15536
|
-
null, // Allowing null/undefined as valid per the constraint
|
|
15537
|
-
undefined
|
|
15538
|
-
];
|
|
15539
|
-
if (!allowed.includes(this.FailoverStrategy)) {
|
|
15540
|
-
result.Errors.push(new core_1.ValidationErrorInfo("FailoverStrategy", "The failover strategy must be 'None', 'PowerRank', 'NextBestModel', 'SameModelDifferentVendor', or left blank.", this.FailoverStrategy, core_1.ValidationErrorType.Failure));
|
|
15551
|
+
ValidateParallelConfigParamRequiredForConfigParamMode(result) {
|
|
15552
|
+
if (this.ParallelizationMode === "ConfigParam" && this.ParallelConfigParam === null) {
|
|
15553
|
+
result.Errors.push(new core_1.ValidationErrorInfo("ParallelConfigParam", "Parallel Config Param must be entered when Parallelization Mode is set to 'ConfigParam'.", this.ParallelConfigParam, core_1.ValidationErrorType.Failure));
|
|
15541
15554
|
}
|
|
15542
15555
|
}
|
|
15543
15556
|
/**
|
|
15544
|
-
* This rule ensures that the
|
|
15557
|
+
* This rule ensures that if the OutputType is set to 'object', an OutputExample must be provided. If the OutputType is anything other than 'object', providing an OutputExample is not required.
|
|
15545
15558
|
* @param result - the ValidationResult object to add any errors or warnings to
|
|
15546
15559
|
* @public
|
|
15547
15560
|
* @method
|
|
15548
15561
|
*/
|
|
15549
|
-
|
|
15550
|
-
|
|
15551
|
-
|
|
15552
|
-
!allowedValues.includes(this.FailoverModelStrategy)) {
|
|
15553
|
-
result.Errors.push(new core_1.ValidationErrorInfo("FailoverModelStrategy", "FailoverModelStrategy must be null or one of: 'RequireSameModel', 'PreferDifferentModel', 'PreferSameModel'.", this.FailoverModelStrategy, core_1.ValidationErrorType.Failure));
|
|
15562
|
+
ValidateOutputExampleWhenOutputTypeObject(result) {
|
|
15563
|
+
if (this.OutputType === "object" && (this.OutputExample === null || this.OutputExample === undefined)) {
|
|
15564
|
+
result.Errors.push(new core_1.ValidationErrorInfo("OutputExample", "When OutputType is 'object', OutputExample must be provided.", this.OutputExample, core_1.ValidationErrorType.Failure));
|
|
15554
15565
|
}
|
|
15555
15566
|
}
|
|
15556
15567
|
/**
|
|
@@ -30366,6 +30377,31 @@ let AIAgentRunEntity = class AIAgentRunEntity extends core_1.BaseEntity {
|
|
|
30366
30377
|
this.Set('Message', value);
|
|
30367
30378
|
}
|
|
30368
30379
|
/**
|
|
30380
|
+
* * Field Name: LastRunID
|
|
30381
|
+
* * Display Name: Last Run ID
|
|
30382
|
+
* * SQL Data Type: uniqueidentifier
|
|
30383
|
+
* * Related Entity/Foreign Key: MJ: AI Agent Runs (vwAIAgentRuns.ID)
|
|
30384
|
+
* * Description: Links to the previous run in a chain. Different from ParentRunID which is for sub-agent hierarchy.
|
|
30385
|
+
*/
|
|
30386
|
+
get LastRunID() {
|
|
30387
|
+
return this.Get('LastRunID');
|
|
30388
|
+
}
|
|
30389
|
+
set LastRunID(value) {
|
|
30390
|
+
this.Set('LastRunID', value);
|
|
30391
|
+
}
|
|
30392
|
+
/**
|
|
30393
|
+
* * Field Name: StartingPayload
|
|
30394
|
+
* * Display Name: Starting Payload
|
|
30395
|
+
* * SQL Data Type: nvarchar(MAX)
|
|
30396
|
+
* * Description: The initial payload provided at the start of this run. Can be populated from the FinalPayload of the LastRun.
|
|
30397
|
+
*/
|
|
30398
|
+
get StartingPayload() {
|
|
30399
|
+
return this.Get('StartingPayload');
|
|
30400
|
+
}
|
|
30401
|
+
set StartingPayload(value) {
|
|
30402
|
+
this.Set('StartingPayload', value);
|
|
30403
|
+
}
|
|
30404
|
+
/**
|
|
30369
30405
|
* * Field Name: Agent
|
|
30370
30406
|
* * Display Name: Agent
|
|
30371
30407
|
* * SQL Data Type: nvarchar(255)
|