@digipair/skill-dsp 0.26.0 → 0.28.0
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 +25 -5
- package/index.esm.js +20 -0
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -23525,14 +23525,14 @@ function indent(str, spaces) {
|
|
|
23525
23525
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
23526
23526
|
// match is required
|
|
23527
23527
|
if (!match) {
|
|
23528
|
-
return
|
|
23528
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
|
|
23529
23529
|
v: nextMatch1
|
|
23530
23530
|
};
|
|
23531
23531
|
}
|
|
23532
23532
|
var token = match.token, offset = match.offset;
|
|
23533
23533
|
i1 += offset;
|
|
23534
23534
|
if (token === " ") {
|
|
23535
|
-
return
|
|
23535
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
|
23536
23536
|
}
|
|
23537
23537
|
tokens1 = _to_consumable_array$6(tokens1).concat([
|
|
23538
23538
|
token
|
|
@@ -23551,7 +23551,7 @@ function indent(str, spaces) {
|
|
|
23551
23551
|
if (contextKeys.some(function(el) {
|
|
23552
23552
|
return el.startsWith(name);
|
|
23553
23553
|
})) {
|
|
23554
|
-
return
|
|
23554
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
|
23555
23555
|
}
|
|
23556
23556
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23557
23557
|
return el === name;
|
|
@@ -23570,9 +23570,9 @@ function indent(str, spaces) {
|
|
|
23570
23570
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23571
23571
|
return el.startsWith(name);
|
|
23572
23572
|
})) {
|
|
23573
|
-
return
|
|
23573
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
|
23574
23574
|
}
|
|
23575
|
-
return
|
|
23575
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
|
|
23576
23576
|
v: nextMatch1
|
|
23577
23577
|
};
|
|
23578
23578
|
};
|
|
@@ -40761,6 +40761,11 @@ let DspService = class DspService {
|
|
|
40761
40761
|
functions: await this.prepareFunctions(functions, context)
|
|
40762
40762
|
});
|
|
40763
40763
|
const result = await gen.forward(input);
|
|
40764
|
+
// add comsumption
|
|
40765
|
+
const consumption = modelInstance.ai.modelUsage;
|
|
40766
|
+
const modelInfo = modelInstance.getModelInfo();
|
|
40767
|
+
const skillLogger = require('@digipair/skill-logger');
|
|
40768
|
+
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40764
40769
|
return result;
|
|
40765
40770
|
}
|
|
40766
40771
|
async chainOfThought(params, _pinsSettingsList, context) {
|
|
@@ -40770,6 +40775,11 @@ let DspService = class DspService {
|
|
|
40770
40775
|
functions: await this.prepareFunctions(functions, context)
|
|
40771
40776
|
});
|
|
40772
40777
|
const result = await gen.forward(input);
|
|
40778
|
+
// add comsumption
|
|
40779
|
+
const consumption = modelInstance.ai.modelUsage;
|
|
40780
|
+
const modelInfo = modelInstance.getModelInfo();
|
|
40781
|
+
const skillLogger = require('@digipair/skill-logger');
|
|
40782
|
+
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40773
40783
|
return result;
|
|
40774
40784
|
}
|
|
40775
40785
|
async react(params, _pinsSettingsList, context) {
|
|
@@ -40779,6 +40789,11 @@ let DspService = class DspService {
|
|
|
40779
40789
|
functions: await this.prepareFunctions(functions, context)
|
|
40780
40790
|
});
|
|
40781
40791
|
const result = await gen.forward(input);
|
|
40792
|
+
// add comsumption
|
|
40793
|
+
const consumption = modelInstance.ai.modelUsage;
|
|
40794
|
+
const modelInfo = modelInstance.getModelInfo();
|
|
40795
|
+
const skillLogger = require('@digipair/skill-logger');
|
|
40796
|
+
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40782
40797
|
return result;
|
|
40783
40798
|
}
|
|
40784
40799
|
async agent(params, _pinsSettingsList, context) {
|
|
@@ -40801,6 +40816,11 @@ let DspService = class DspService {
|
|
|
40801
40816
|
return agent;
|
|
40802
40817
|
}
|
|
40803
40818
|
const result = await agent.forward(input);
|
|
40819
|
+
// add comsumption
|
|
40820
|
+
const consumption = modelInstance.ai.modelUsage;
|
|
40821
|
+
const modelInfo = modelInstance.getModelInfo();
|
|
40822
|
+
const skillLogger = require('@digipair/skill-logger');
|
|
40823
|
+
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40804
40824
|
return result;
|
|
40805
40825
|
}
|
|
40806
40826
|
};
|
package/index.esm.js
CHANGED
|
@@ -40735,6 +40735,11 @@ let DspService = class DspService {
|
|
|
40735
40735
|
functions: await this.prepareFunctions(functions, context)
|
|
40736
40736
|
});
|
|
40737
40737
|
const result = await gen.forward(input);
|
|
40738
|
+
// add comsumption
|
|
40739
|
+
const consumption = modelInstance.ai.modelUsage;
|
|
40740
|
+
const modelInfo = modelInstance.getModelInfo();
|
|
40741
|
+
const skillLogger = require('@digipair/skill-logger');
|
|
40742
|
+
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40738
40743
|
return result;
|
|
40739
40744
|
}
|
|
40740
40745
|
async chainOfThought(params, _pinsSettingsList, context) {
|
|
@@ -40744,6 +40749,11 @@ let DspService = class DspService {
|
|
|
40744
40749
|
functions: await this.prepareFunctions(functions, context)
|
|
40745
40750
|
});
|
|
40746
40751
|
const result = await gen.forward(input);
|
|
40752
|
+
// add comsumption
|
|
40753
|
+
const consumption = modelInstance.ai.modelUsage;
|
|
40754
|
+
const modelInfo = modelInstance.getModelInfo();
|
|
40755
|
+
const skillLogger = require('@digipair/skill-logger');
|
|
40756
|
+
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40747
40757
|
return result;
|
|
40748
40758
|
}
|
|
40749
40759
|
async react(params, _pinsSettingsList, context) {
|
|
@@ -40753,6 +40763,11 @@ let DspService = class DspService {
|
|
|
40753
40763
|
functions: await this.prepareFunctions(functions, context)
|
|
40754
40764
|
});
|
|
40755
40765
|
const result = await gen.forward(input);
|
|
40766
|
+
// add comsumption
|
|
40767
|
+
const consumption = modelInstance.ai.modelUsage;
|
|
40768
|
+
const modelInfo = modelInstance.getModelInfo();
|
|
40769
|
+
const skillLogger = require('@digipair/skill-logger');
|
|
40770
|
+
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40756
40771
|
return result;
|
|
40757
40772
|
}
|
|
40758
40773
|
async agent(params, _pinsSettingsList, context) {
|
|
@@ -40775,6 +40790,11 @@ let DspService = class DspService {
|
|
|
40775
40790
|
return agent;
|
|
40776
40791
|
}
|
|
40777
40792
|
const result = await agent.forward(input);
|
|
40793
|
+
// add comsumption
|
|
40794
|
+
const consumption = modelInstance.ai.modelUsage;
|
|
40795
|
+
const modelInfo = modelInstance.getModelInfo();
|
|
40796
|
+
const skillLogger = require('@digipair/skill-logger');
|
|
40797
|
+
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40778
40798
|
return result;
|
|
40779
40799
|
}
|
|
40780
40800
|
};
|