@digipair/skill-dsp 0.70.4 → 0.71.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.
- package/index.cjs.js +7 -7
- package/index.esm.js +19 -15
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -14630,10 +14630,10 @@ var AxChainOfThought = /*#__PURE__*/ function(AxGen) {
|
|
|
14630
14630
|
|
|
14631
14631
|
let DspService = class DspService {
|
|
14632
14632
|
async prepareFunctions(functions, context) {
|
|
14633
|
-
return await Promise.all(functions.map(async (f)=>_extends({}, f, {
|
|
14633
|
+
return await Promise.all(functions.map(async (f, i)=>_extends({}, f, {
|
|
14634
14634
|
func: async (params)=>await engine.executePinsList(f.func, _extends({}, context, {
|
|
14635
14635
|
params
|
|
14636
|
-
}))
|
|
14636
|
+
}), `${context.__PATH__}.functions[${i}]`)
|
|
14637
14637
|
})));
|
|
14638
14638
|
}
|
|
14639
14639
|
async model(params, _pinsSettingsList, _context) {
|
|
@@ -14682,7 +14682,7 @@ let DspService = class DspService {
|
|
|
14682
14682
|
}
|
|
14683
14683
|
async generate(params, _pinsSettingsList, context) {
|
|
14684
14684
|
const { model = context.privates.MODEL_DSP, functions = [], signature, input } = params;
|
|
14685
|
-
const modelInstance = await engine.executePinsList(model, context);
|
|
14685
|
+
const modelInstance = await engine.executePinsList(model, context, `${context.__PATH__}.model`);
|
|
14686
14686
|
const gen = new AxGen(signature, {
|
|
14687
14687
|
functions: await this.prepareFunctions(functions, context)
|
|
14688
14688
|
});
|
|
@@ -14698,7 +14698,7 @@ let DspService = class DspService {
|
|
|
14698
14698
|
}
|
|
14699
14699
|
async chainOfThought(params, _pinsSettingsList, context) {
|
|
14700
14700
|
const { model = context.privates.MODEL_DSP, functions = [], signature, input } = params;
|
|
14701
|
-
const modelInstance = await engine.executePinsList(model, context);
|
|
14701
|
+
const modelInstance = await engine.executePinsList(model, context, `${context.__PATH__}.model`);
|
|
14702
14702
|
const gen = new AxChainOfThought(signature, {
|
|
14703
14703
|
functions: await this.prepareFunctions(functions, context)
|
|
14704
14704
|
});
|
|
@@ -14714,19 +14714,19 @@ let DspService = class DspService {
|
|
|
14714
14714
|
}
|
|
14715
14715
|
async agent(params, _pinsSettingsList, context) {
|
|
14716
14716
|
const { model = context.privates.MODEL_DSP, functions = [], agents = [], forward = true, name, description, signature, input } = params;
|
|
14717
|
-
const modelInstance = await engine.executePinsList(model, context);
|
|
14717
|
+
const modelInstance = await engine.executePinsList(model, context, `${context.__PATH__}.model`);
|
|
14718
14718
|
const agent = new AxAgent({
|
|
14719
14719
|
name,
|
|
14720
14720
|
description,
|
|
14721
14721
|
signature,
|
|
14722
14722
|
functions: await this.prepareFunctions(functions, context),
|
|
14723
|
-
agents: await Promise.all(agents.map(async (execute)=>await engine.executePinsList([
|
|
14723
|
+
agents: await Promise.all(agents.map(async (execute, i)=>await engine.executePinsList([
|
|
14724
14724
|
_extends({}, execute, {
|
|
14725
14725
|
properties: _extends({}, execute.properties, {
|
|
14726
14726
|
forward: false
|
|
14727
14727
|
})
|
|
14728
14728
|
})
|
|
14729
|
-
], context)))
|
|
14729
|
+
], context, `${context.__PATH__}.agents[${i}]`)))
|
|
14730
14730
|
});
|
|
14731
14731
|
if (!forward) {
|
|
14732
14732
|
return agent;
|
package/index.esm.js
CHANGED
|
@@ -23912,14 +23912,14 @@ function indent(str, spaces) {
|
|
|
23912
23912
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
23913
23913
|
// match is required
|
|
23914
23914
|
if (!match) {
|
|
23915
|
-
return nextMatch = nextMatch1,
|
|
23915
|
+
return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
|
|
23916
23916
|
v: nextMatch1
|
|
23917
23917
|
};
|
|
23918
23918
|
}
|
|
23919
23919
|
var token = match.token, offset = match.offset;
|
|
23920
23920
|
i1 += offset;
|
|
23921
23921
|
if (token === " ") {
|
|
23922
|
-
return nextMatch = nextMatch1,
|
|
23922
|
+
return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
|
|
23923
23923
|
}
|
|
23924
23924
|
tokens1 = _to_consumable_array$2(tokens1).concat([
|
|
23925
23925
|
token
|
|
@@ -23938,7 +23938,7 @@ function indent(str, spaces) {
|
|
|
23938
23938
|
if (contextKeys.some(function(el) {
|
|
23939
23939
|
return el.startsWith(name);
|
|
23940
23940
|
})) {
|
|
23941
|
-
return nextMatch = nextMatch1,
|
|
23941
|
+
return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
|
|
23942
23942
|
}
|
|
23943
23943
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23944
23944
|
return el === name;
|
|
@@ -23957,9 +23957,9 @@ function indent(str, spaces) {
|
|
|
23957
23957
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23958
23958
|
return el.startsWith(name);
|
|
23959
23959
|
})) {
|
|
23960
|
-
return nextMatch = nextMatch1,
|
|
23960
|
+
return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
|
|
23961
23961
|
}
|
|
23962
|
-
return nextMatch = nextMatch1,
|
|
23962
|
+
return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
|
|
23963
23963
|
v: nextMatch1
|
|
23964
23964
|
};
|
|
23965
23965
|
};
|
|
@@ -27848,7 +27848,8 @@ var _globalInstance___DIGIPAIR_CONFIG__;
|
|
|
27848
27848
|
const _config = globalInstance.__DIGIPAIR_CONFIG__ = (_globalInstance___DIGIPAIR_CONFIG__ = globalInstance.__DIGIPAIR_CONFIG__) != null ? _globalInstance___DIGIPAIR_CONFIG__ : {
|
|
27849
27849
|
LIBRARIES: {},
|
|
27850
27850
|
BASE_URL: 'https://cdn.jsdelivr.net/npm',
|
|
27851
|
-
ALIAS: []
|
|
27851
|
+
ALIAS: [],
|
|
27852
|
+
LOGGER: (level, path, message, context, data)=>{}
|
|
27852
27853
|
};
|
|
27853
27854
|
const isRemoteVersion = /^https?:\/\/[^\s/$.?#].[^\s]*$/;
|
|
27854
27855
|
const isPinsSettings = (value)=>{
|
|
@@ -27889,6 +27890,7 @@ const applyTemplate = (value, context)=>{
|
|
|
27889
27890
|
};
|
|
27890
27891
|
const executePins = async (settingsOrigin, context = {})=>{
|
|
27891
27892
|
var _settings_conditions, _settings_conditions1;
|
|
27893
|
+
_config.LOGGER('INFO', context.__PATH__, 'execute:start', context);
|
|
27892
27894
|
let settings = preparePinsSettings(settingsOrigin, context);
|
|
27893
27895
|
const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
|
|
27894
27896
|
const config = context.config || {};
|
|
@@ -27936,6 +27938,7 @@ const executePins = async (settingsOrigin, context = {})=>{
|
|
|
27936
27938
|
}
|
|
27937
27939
|
results.push(itemResult);
|
|
27938
27940
|
}
|
|
27941
|
+
_config.LOGGER('INFO', context.__PATH__, 'execute:end', context, results);
|
|
27939
27942
|
return results;
|
|
27940
27943
|
}
|
|
27941
27944
|
if (typeof ((_settings_conditions1 = settings.conditions) == null ? void 0 : _settings_conditions1.if) !== 'undefined' && !settings.conditions.if) {
|
|
@@ -27948,7 +27951,7 @@ const executePins = async (settingsOrigin, context = {})=>{
|
|
|
27948
27951
|
}
|
|
27949
27952
|
return await pins(settings.properties, settings.pins, context);
|
|
27950
27953
|
};
|
|
27951
|
-
const executePinsList = async (pinsSettingsList, context)=>{
|
|
27954
|
+
const executePinsList = async (pinsSettingsList, context, path = 'root')=>{
|
|
27952
27955
|
let previous = {};
|
|
27953
27956
|
for(let i = 0; i < pinsSettingsList.length; i++){
|
|
27954
27957
|
const settings = pinsSettingsList[i];
|
|
@@ -27958,7 +27961,8 @@ const executePinsList = async (pinsSettingsList, context)=>{
|
|
|
27958
27961
|
parent: {
|
|
27959
27962
|
previous: context.previous,
|
|
27960
27963
|
parent: context.parent
|
|
27961
|
-
}
|
|
27964
|
+
},
|
|
27965
|
+
__PATH__: `${path}[${i}]`
|
|
27962
27966
|
}));
|
|
27963
27967
|
} catch (error) {
|
|
27964
27968
|
if (error === 'DIGIPAIR_CONDITIONS_IF_FALSE') {
|
|
@@ -42585,10 +42589,10 @@ var AxChainOfThought = /*#__PURE__*/ function(AxGen) {
|
|
|
42585
42589
|
|
|
42586
42590
|
let DspService = class DspService {
|
|
42587
42591
|
async prepareFunctions(functions, context) {
|
|
42588
|
-
return await Promise.all(functions.map(async (f)=>_extends({}, f, {
|
|
42592
|
+
return await Promise.all(functions.map(async (f, i)=>_extends({}, f, {
|
|
42589
42593
|
func: async (params)=>await executePinsList(f.func, _extends({}, context, {
|
|
42590
42594
|
params
|
|
42591
|
-
}))
|
|
42595
|
+
}), `${context.__PATH__}.functions[${i}]`)
|
|
42592
42596
|
})));
|
|
42593
42597
|
}
|
|
42594
42598
|
async model(params, _pinsSettingsList, _context) {
|
|
@@ -42637,7 +42641,7 @@ let DspService = class DspService {
|
|
|
42637
42641
|
}
|
|
42638
42642
|
async generate(params, _pinsSettingsList, context) {
|
|
42639
42643
|
const { model = context.privates.MODEL_DSP, functions = [], signature, input } = params;
|
|
42640
|
-
const modelInstance = await executePinsList(model, context);
|
|
42644
|
+
const modelInstance = await executePinsList(model, context, `${context.__PATH__}.model`);
|
|
42641
42645
|
const gen = new AxGen(signature, {
|
|
42642
42646
|
functions: await this.prepareFunctions(functions, context)
|
|
42643
42647
|
});
|
|
@@ -42653,7 +42657,7 @@ let DspService = class DspService {
|
|
|
42653
42657
|
}
|
|
42654
42658
|
async chainOfThought(params, _pinsSettingsList, context) {
|
|
42655
42659
|
const { model = context.privates.MODEL_DSP, functions = [], signature, input } = params;
|
|
42656
|
-
const modelInstance = await executePinsList(model, context);
|
|
42660
|
+
const modelInstance = await executePinsList(model, context, `${context.__PATH__}.model`);
|
|
42657
42661
|
const gen = new AxChainOfThought(signature, {
|
|
42658
42662
|
functions: await this.prepareFunctions(functions, context)
|
|
42659
42663
|
});
|
|
@@ -42669,19 +42673,19 @@ let DspService = class DspService {
|
|
|
42669
42673
|
}
|
|
42670
42674
|
async agent(params, _pinsSettingsList, context) {
|
|
42671
42675
|
const { model = context.privates.MODEL_DSP, functions = [], agents = [], forward = true, name, description, signature, input } = params;
|
|
42672
|
-
const modelInstance = await executePinsList(model, context);
|
|
42676
|
+
const modelInstance = await executePinsList(model, context, `${context.__PATH__}.model`);
|
|
42673
42677
|
const agent = new AxAgent({
|
|
42674
42678
|
name,
|
|
42675
42679
|
description,
|
|
42676
42680
|
signature,
|
|
42677
42681
|
functions: await this.prepareFunctions(functions, context),
|
|
42678
|
-
agents: await Promise.all(agents.map(async (execute)=>await executePinsList([
|
|
42682
|
+
agents: await Promise.all(agents.map(async (execute, i)=>await executePinsList([
|
|
42679
42683
|
_extends({}, execute, {
|
|
42680
42684
|
properties: _extends({}, execute.properties, {
|
|
42681
42685
|
forward: false
|
|
42682
42686
|
})
|
|
42683
42687
|
})
|
|
42684
|
-
], context)))
|
|
42688
|
+
], context, `${context.__PATH__}.agents[${i}]`)))
|
|
42685
42689
|
});
|
|
42686
42690
|
if (!forward) {
|
|
42687
42691
|
return agent;
|