@digipair/skill-dsp 0.100.0 → 0.101.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 +1 -1
- package/index.esm.js +8 -6
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -22920,7 +22920,7 @@ let DspService = class DspService {
|
|
|
22920
22920
|
var _modelInstance_ai;
|
|
22921
22921
|
// add comsumption
|
|
22922
22922
|
const ai = (_modelInstance_ai = modelInstance.ai) != null ? _modelInstance_ai : modelInstance;
|
|
22923
|
-
const consumption = ai.
|
|
22923
|
+
const consumption = ai.tokensUsed;
|
|
22924
22924
|
const skillLogger = require('@digipair/skill-logger');
|
|
22925
22925
|
await skillLogger.addConsumption(context, ai.name, ai.defaults.model, consumption.promptTokens, consumption.completionTokens);
|
|
22926
22926
|
return result;
|
package/index.esm.js
CHANGED
|
@@ -23899,14 +23899,14 @@ function indent(str, spaces) {
|
|
|
23899
23899
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
23900
23900
|
// match is required
|
|
23901
23901
|
if (!match) {
|
|
23902
|
-
return
|
|
23902
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
|
|
23903
23903
|
v: nextMatch1
|
|
23904
23904
|
};
|
|
23905
23905
|
}
|
|
23906
23906
|
var token = match.token, offset = match.offset;
|
|
23907
23907
|
i1 += offset;
|
|
23908
23908
|
if (token === " ") {
|
|
23909
|
-
return
|
|
23909
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
|
23910
23910
|
}
|
|
23911
23911
|
tokens1 = _to_consumable_array$2(tokens1).concat([
|
|
23912
23912
|
token
|
|
@@ -23925,7 +23925,7 @@ function indent(str, spaces) {
|
|
|
23925
23925
|
if (contextKeys.some(function(el) {
|
|
23926
23926
|
return el.startsWith(name);
|
|
23927
23927
|
})) {
|
|
23928
|
-
return
|
|
23928
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
|
23929
23929
|
}
|
|
23930
23930
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23931
23931
|
return el === name;
|
|
@@ -23944,9 +23944,9 @@ function indent(str, spaces) {
|
|
|
23944
23944
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23945
23945
|
return el.startsWith(name);
|
|
23946
23946
|
})) {
|
|
23947
|
-
return
|
|
23947
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
|
23948
23948
|
}
|
|
23949
|
-
return
|
|
23949
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
|
|
23950
23950
|
v: nextMatch1
|
|
23951
23951
|
};
|
|
23952
23952
|
};
|
|
@@ -27856,6 +27856,8 @@ const applyTemplate = (value, context)=>{
|
|
|
27856
27856
|
btoa: (value)=>btoa(value),
|
|
27857
27857
|
encodeURIComponent: (value)=>encodeURIComponent(value),
|
|
27858
27858
|
decodeURIComponent: (value)=>decodeURIComponent(value),
|
|
27859
|
+
encodeUTF8: (value)=>Array.from(new TextEncoder().encode(value)).map((b)=>String.fromCharCode(b)).join(''),
|
|
27860
|
+
decodeUTF8: (value)=>new TextDecoder().decode(new Uint8Array(Array.from(value).map((c)=>c.charCodeAt(0)))),
|
|
27859
27861
|
JSONparse: (value)=>JSON.parse(value),
|
|
27860
27862
|
JSONstringify: (value)=>JSON.stringify(value)
|
|
27861
27863
|
}));
|
|
@@ -50883,7 +50885,7 @@ let DspService = class DspService {
|
|
|
50883
50885
|
var _modelInstance_ai;
|
|
50884
50886
|
// add comsumption
|
|
50885
50887
|
const ai = (_modelInstance_ai = modelInstance.ai) != null ? _modelInstance_ai : modelInstance;
|
|
50886
|
-
const consumption = ai.
|
|
50888
|
+
const consumption = ai.tokensUsed;
|
|
50887
50889
|
const skillLogger = require('@digipair/skill-logger');
|
|
50888
50890
|
await skillLogger.addConsumption(context, ai.name, ai.defaults.model, consumption.promptTokens, consumption.completionTokens);
|
|
50889
50891
|
return result;
|