@digipair/skill-dsp 0.28.3 → 0.28.4
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 +21 -13
- package/index.esm.js +21 -13
- 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,9 +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
|
+
var _modelInstance_ai;
|
|
40764
40765
|
// add comsumption
|
|
40765
|
-
const
|
|
40766
|
-
const
|
|
40766
|
+
const ai = (_modelInstance_ai = modelInstance.ai) != null ? _modelInstance_ai : modelInstance;
|
|
40767
|
+
const consumption = ai.modelUsage;
|
|
40768
|
+
const modelInfo = ai.getModelInfo();
|
|
40767
40769
|
const skillLogger = require('@digipair/skill-logger');
|
|
40768
40770
|
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40769
40771
|
return result;
|
|
@@ -40775,9 +40777,11 @@ let DspService = class DspService {
|
|
|
40775
40777
|
functions: await this.prepareFunctions(functions, context)
|
|
40776
40778
|
});
|
|
40777
40779
|
const result = await gen.forward(input);
|
|
40780
|
+
var _modelInstance_ai;
|
|
40778
40781
|
// add comsumption
|
|
40779
|
-
const
|
|
40780
|
-
const
|
|
40782
|
+
const ai = (_modelInstance_ai = modelInstance.ai) != null ? _modelInstance_ai : modelInstance;
|
|
40783
|
+
const consumption = ai.modelUsage;
|
|
40784
|
+
const modelInfo = ai.getModelInfo();
|
|
40781
40785
|
const skillLogger = require('@digipair/skill-logger');
|
|
40782
40786
|
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40783
40787
|
return result;
|
|
@@ -40789,9 +40793,11 @@ let DspService = class DspService {
|
|
|
40789
40793
|
functions: await this.prepareFunctions(functions, context)
|
|
40790
40794
|
});
|
|
40791
40795
|
const result = await gen.forward(input);
|
|
40796
|
+
var _modelInstance_ai;
|
|
40792
40797
|
// add comsumption
|
|
40793
|
-
const
|
|
40794
|
-
const
|
|
40798
|
+
const ai = (_modelInstance_ai = modelInstance.ai) != null ? _modelInstance_ai : modelInstance;
|
|
40799
|
+
const consumption = ai.modelUsage;
|
|
40800
|
+
const modelInfo = ai.getModelInfo();
|
|
40795
40801
|
const skillLogger = require('@digipair/skill-logger');
|
|
40796
40802
|
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40797
40803
|
return result;
|
|
@@ -40816,9 +40822,11 @@ let DspService = class DspService {
|
|
|
40816
40822
|
return agent;
|
|
40817
40823
|
}
|
|
40818
40824
|
const result = await agent.forward(input);
|
|
40825
|
+
var _modelInstance_ai;
|
|
40819
40826
|
// add comsumption
|
|
40820
|
-
const
|
|
40821
|
-
const
|
|
40827
|
+
const ai = (_modelInstance_ai = modelInstance.ai) != null ? _modelInstance_ai : modelInstance;
|
|
40828
|
+
const consumption = ai.modelUsage;
|
|
40829
|
+
const modelInfo = ai.getModelInfo();
|
|
40822
40830
|
const skillLogger = require('@digipair/skill-logger');
|
|
40823
40831
|
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40824
40832
|
return result;
|
package/index.esm.js
CHANGED
|
@@ -23499,14 +23499,14 @@ function indent(str, spaces) {
|
|
|
23499
23499
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
23500
23500
|
// match is required
|
|
23501
23501
|
if (!match) {
|
|
23502
|
-
return
|
|
23502
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
|
|
23503
23503
|
v: nextMatch1
|
|
23504
23504
|
};
|
|
23505
23505
|
}
|
|
23506
23506
|
var token = match.token, offset = match.offset;
|
|
23507
23507
|
i1 += offset;
|
|
23508
23508
|
if (token === " ") {
|
|
23509
|
-
return
|
|
23509
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
|
|
23510
23510
|
}
|
|
23511
23511
|
tokens1 = _to_consumable_array$6(tokens1).concat([
|
|
23512
23512
|
token
|
|
@@ -23525,7 +23525,7 @@ function indent(str, spaces) {
|
|
|
23525
23525
|
if (contextKeys.some(function(el) {
|
|
23526
23526
|
return el.startsWith(name);
|
|
23527
23527
|
})) {
|
|
23528
|
-
return
|
|
23528
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
|
|
23529
23529
|
}
|
|
23530
23530
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23531
23531
|
return el === name;
|
|
@@ -23544,9 +23544,9 @@ function indent(str, spaces) {
|
|
|
23544
23544
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23545
23545
|
return el.startsWith(name);
|
|
23546
23546
|
})) {
|
|
23547
|
-
return
|
|
23547
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
|
|
23548
23548
|
}
|
|
23549
|
-
return
|
|
23549
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
|
|
23550
23550
|
v: nextMatch1
|
|
23551
23551
|
};
|
|
23552
23552
|
};
|
|
@@ -40735,9 +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
|
+
var _modelInstance_ai;
|
|
40738
40739
|
// add comsumption
|
|
40739
|
-
const
|
|
40740
|
-
const
|
|
40740
|
+
const ai = (_modelInstance_ai = modelInstance.ai) != null ? _modelInstance_ai : modelInstance;
|
|
40741
|
+
const consumption = ai.modelUsage;
|
|
40742
|
+
const modelInfo = ai.getModelInfo();
|
|
40741
40743
|
const skillLogger = require('@digipair/skill-logger');
|
|
40742
40744
|
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40743
40745
|
return result;
|
|
@@ -40749,9 +40751,11 @@ let DspService = class DspService {
|
|
|
40749
40751
|
functions: await this.prepareFunctions(functions, context)
|
|
40750
40752
|
});
|
|
40751
40753
|
const result = await gen.forward(input);
|
|
40754
|
+
var _modelInstance_ai;
|
|
40752
40755
|
// add comsumption
|
|
40753
|
-
const
|
|
40754
|
-
const
|
|
40756
|
+
const ai = (_modelInstance_ai = modelInstance.ai) != null ? _modelInstance_ai : modelInstance;
|
|
40757
|
+
const consumption = ai.modelUsage;
|
|
40758
|
+
const modelInfo = ai.getModelInfo();
|
|
40755
40759
|
const skillLogger = require('@digipair/skill-logger');
|
|
40756
40760
|
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40757
40761
|
return result;
|
|
@@ -40763,9 +40767,11 @@ let DspService = class DspService {
|
|
|
40763
40767
|
functions: await this.prepareFunctions(functions, context)
|
|
40764
40768
|
});
|
|
40765
40769
|
const result = await gen.forward(input);
|
|
40770
|
+
var _modelInstance_ai;
|
|
40766
40771
|
// add comsumption
|
|
40767
|
-
const
|
|
40768
|
-
const
|
|
40772
|
+
const ai = (_modelInstance_ai = modelInstance.ai) != null ? _modelInstance_ai : modelInstance;
|
|
40773
|
+
const consumption = ai.modelUsage;
|
|
40774
|
+
const modelInfo = ai.getModelInfo();
|
|
40769
40775
|
const skillLogger = require('@digipair/skill-logger');
|
|
40770
40776
|
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40771
40777
|
return result;
|
|
@@ -40790,9 +40796,11 @@ let DspService = class DspService {
|
|
|
40790
40796
|
return agent;
|
|
40791
40797
|
}
|
|
40792
40798
|
const result = await agent.forward(input);
|
|
40799
|
+
var _modelInstance_ai;
|
|
40793
40800
|
// add comsumption
|
|
40794
|
-
const
|
|
40795
|
-
const
|
|
40801
|
+
const ai = (_modelInstance_ai = modelInstance.ai) != null ? _modelInstance_ai : modelInstance;
|
|
40802
|
+
const consumption = ai.modelUsage;
|
|
40803
|
+
const modelInfo = ai.getModelInfo();
|
|
40796
40804
|
const skillLogger = require('@digipair/skill-logger');
|
|
40797
40805
|
await skillLogger.addConsumption(context, modelInfo.provider, modelInfo.name, consumption.promptTokens, consumption.completionTokens);
|
|
40798
40806
|
return result;
|