@digipair/skill-dsp 0.72.7 → 0.72.8
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 +13 -16
- package/index.esm.js +18 -21
- package/package.json +1 -1
- package/schema.fr.json +18 -0
- package/schema.json +18 -0
package/index.cjs.js
CHANGED
|
@@ -124469,33 +124469,31 @@ let DspService = class DspService {
|
|
|
124469
124469
|
functions: await this.prepareFunctions(functions, context)
|
|
124470
124470
|
});
|
|
124471
124471
|
const result = await gen.forward(modelInstance, input, options);
|
|
124472
|
-
var
|
|
124472
|
+
var _modelInstance_ia;
|
|
124473
124473
|
// add comsumption
|
|
124474
|
-
const ai = (
|
|
124474
|
+
const ai = (_modelInstance_ia = modelInstance.ia) != null ? _modelInstance_ia : modelInstance;
|
|
124475
124475
|
const consumption = ai.modelUsage;
|
|
124476
|
-
const modelInfo = ai.getModelInfo();
|
|
124477
124476
|
const skillLogger = require('@digipair/skill-logger');
|
|
124478
|
-
await skillLogger.addConsumption(context,
|
|
124477
|
+
await skillLogger.addConsumption(context, ai.name, ai.defaults.model, consumption.promptTokens, consumption.completionTokens);
|
|
124479
124478
|
return result;
|
|
124480
124479
|
}
|
|
124481
124480
|
async chainOfThought(params, _pinsSettingsList, context) {
|
|
124482
|
-
const { model = context.privates.MODEL_DSP, functions = [], signature, input } = params;
|
|
124481
|
+
const { model = context.privates.MODEL_DSP, functions = [], options = {}, signature, input } = params;
|
|
124483
124482
|
const modelInstance = await engine.executePinsList(model, context, `${context.__PATH__}.model`);
|
|
124484
124483
|
const gen = new AxChainOfThought(signature, {
|
|
124485
124484
|
functions: await this.prepareFunctions(functions, context)
|
|
124486
124485
|
});
|
|
124487
|
-
const result = await gen.forward(modelInstance, input);
|
|
124488
|
-
var
|
|
124486
|
+
const result = await gen.forward(modelInstance, input, options);
|
|
124487
|
+
var _modelInstance_ia;
|
|
124489
124488
|
// add comsumption
|
|
124490
|
-
const ai = (
|
|
124489
|
+
const ai = (_modelInstance_ia = modelInstance.ia) != null ? _modelInstance_ia : modelInstance;
|
|
124491
124490
|
const consumption = ai.modelUsage;
|
|
124492
|
-
const modelInfo = ai.getModelInfo();
|
|
124493
124491
|
const skillLogger = require('@digipair/skill-logger');
|
|
124494
|
-
await skillLogger.addConsumption(context,
|
|
124492
|
+
await skillLogger.addConsumption(context, ai.name, ai.defaults.model, consumption.promptTokens, consumption.completionTokens);
|
|
124495
124493
|
return result;
|
|
124496
124494
|
}
|
|
124497
124495
|
async agent(params, _pinsSettingsList, context) {
|
|
124498
|
-
const { model = context.privates.MODEL_DSP, functions = [], agents = [], forward = true, name, description, signature, input } = params;
|
|
124496
|
+
const { model = context.privates.MODEL_DSP, functions = [], agents = [], forward = true, options = {}, name, description, signature, input } = params;
|
|
124499
124497
|
const modelInstance = await engine.executePinsList(model, context, `${context.__PATH__}.model`);
|
|
124500
124498
|
const agent = new AxAgent({
|
|
124501
124499
|
name,
|
|
@@ -124513,14 +124511,13 @@ let DspService = class DspService {
|
|
|
124513
124511
|
if (!forward) {
|
|
124514
124512
|
return agent;
|
|
124515
124513
|
}
|
|
124516
|
-
const result = await agent.forward(modelInstance, input);
|
|
124517
|
-
var
|
|
124514
|
+
const result = await agent.forward(modelInstance, input, options);
|
|
124515
|
+
var _modelInstance_ia;
|
|
124518
124516
|
// add comsumption
|
|
124519
|
-
const ai = (
|
|
124517
|
+
const ai = (_modelInstance_ia = modelInstance.ia) != null ? _modelInstance_ia : modelInstance;
|
|
124520
124518
|
const consumption = ai.modelUsage;
|
|
124521
|
-
const modelInfo = ai.getModelInfo();
|
|
124522
124519
|
const skillLogger = require('@digipair/skill-logger');
|
|
124523
|
-
await skillLogger.addConsumption(context,
|
|
124520
|
+
await skillLogger.addConsumption(context, ai.name, ai.defaults.model, consumption.promptTokens, consumption.completionTokens);
|
|
124524
124521
|
return result;
|
|
124525
124522
|
}
|
|
124526
124523
|
};
|
package/index.esm.js
CHANGED
|
@@ -23951,14 +23951,14 @@ function indent(str, spaces) {
|
|
|
23951
23951
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
23952
23952
|
// match is required
|
|
23953
23953
|
if (!match) {
|
|
23954
|
-
return
|
|
23954
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
|
|
23955
23955
|
v: nextMatch1
|
|
23956
23956
|
};
|
|
23957
23957
|
}
|
|
23958
23958
|
var token = match.token, offset = match.offset;
|
|
23959
23959
|
i1 += offset;
|
|
23960
23960
|
if (token === " ") {
|
|
23961
|
-
return
|
|
23961
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
|
|
23962
23962
|
}
|
|
23963
23963
|
tokens1 = _to_consumable_array$5(tokens1).concat([
|
|
23964
23964
|
token
|
|
@@ -23977,7 +23977,7 @@ function indent(str, spaces) {
|
|
|
23977
23977
|
if (contextKeys.some(function(el) {
|
|
23978
23978
|
return el.startsWith(name);
|
|
23979
23979
|
})) {
|
|
23980
|
-
return
|
|
23980
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
|
|
23981
23981
|
}
|
|
23982
23982
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23983
23983
|
return el === name;
|
|
@@ -23996,9 +23996,9 @@ function indent(str, spaces) {
|
|
|
23996
23996
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23997
23997
|
return el.startsWith(name);
|
|
23998
23998
|
})) {
|
|
23999
|
-
return
|
|
23999
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
|
|
24000
24000
|
}
|
|
24001
|
-
return
|
|
24001
|
+
return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
|
|
24002
24002
|
v: nextMatch1
|
|
24003
24003
|
};
|
|
24004
24004
|
};
|
|
@@ -152408,33 +152408,31 @@ let DspService = class DspService {
|
|
|
152408
152408
|
functions: await this.prepareFunctions(functions, context)
|
|
152409
152409
|
});
|
|
152410
152410
|
const result = await gen.forward(modelInstance, input, options);
|
|
152411
|
-
var
|
|
152411
|
+
var _modelInstance_ia;
|
|
152412
152412
|
// add comsumption
|
|
152413
|
-
const ai = (
|
|
152413
|
+
const ai = (_modelInstance_ia = modelInstance.ia) != null ? _modelInstance_ia : modelInstance;
|
|
152414
152414
|
const consumption = ai.modelUsage;
|
|
152415
|
-
const modelInfo = ai.getModelInfo();
|
|
152416
152415
|
const skillLogger = require('@digipair/skill-logger');
|
|
152417
|
-
await skillLogger.addConsumption(context,
|
|
152416
|
+
await skillLogger.addConsumption(context, ai.name, ai.defaults.model, consumption.promptTokens, consumption.completionTokens);
|
|
152418
152417
|
return result;
|
|
152419
152418
|
}
|
|
152420
152419
|
async chainOfThought(params, _pinsSettingsList, context) {
|
|
152421
|
-
const { model = context.privates.MODEL_DSP, functions = [], signature, input } = params;
|
|
152420
|
+
const { model = context.privates.MODEL_DSP, functions = [], options = {}, signature, input } = params;
|
|
152422
152421
|
const modelInstance = await executePinsList(model, context, `${context.__PATH__}.model`);
|
|
152423
152422
|
const gen = new AxChainOfThought(signature, {
|
|
152424
152423
|
functions: await this.prepareFunctions(functions, context)
|
|
152425
152424
|
});
|
|
152426
|
-
const result = await gen.forward(modelInstance, input);
|
|
152427
|
-
var
|
|
152425
|
+
const result = await gen.forward(modelInstance, input, options);
|
|
152426
|
+
var _modelInstance_ia;
|
|
152428
152427
|
// add comsumption
|
|
152429
|
-
const ai = (
|
|
152428
|
+
const ai = (_modelInstance_ia = modelInstance.ia) != null ? _modelInstance_ia : modelInstance;
|
|
152430
152429
|
const consumption = ai.modelUsage;
|
|
152431
|
-
const modelInfo = ai.getModelInfo();
|
|
152432
152430
|
const skillLogger = require('@digipair/skill-logger');
|
|
152433
|
-
await skillLogger.addConsumption(context,
|
|
152431
|
+
await skillLogger.addConsumption(context, ai.name, ai.defaults.model, consumption.promptTokens, consumption.completionTokens);
|
|
152434
152432
|
return result;
|
|
152435
152433
|
}
|
|
152436
152434
|
async agent(params, _pinsSettingsList, context) {
|
|
152437
|
-
const { model = context.privates.MODEL_DSP, functions = [], agents = [], forward = true, name, description, signature, input } = params;
|
|
152435
|
+
const { model = context.privates.MODEL_DSP, functions = [], agents = [], forward = true, options = {}, name, description, signature, input } = params;
|
|
152438
152436
|
const modelInstance = await executePinsList(model, context, `${context.__PATH__}.model`);
|
|
152439
152437
|
const agent = new AxAgent({
|
|
152440
152438
|
name,
|
|
@@ -152452,14 +152450,13 @@ let DspService = class DspService {
|
|
|
152452
152450
|
if (!forward) {
|
|
152453
152451
|
return agent;
|
|
152454
152452
|
}
|
|
152455
|
-
const result = await agent.forward(modelInstance, input);
|
|
152456
|
-
var
|
|
152453
|
+
const result = await agent.forward(modelInstance, input, options);
|
|
152454
|
+
var _modelInstance_ia;
|
|
152457
152455
|
// add comsumption
|
|
152458
|
-
const ai = (
|
|
152456
|
+
const ai = (_modelInstance_ia = modelInstance.ia) != null ? _modelInstance_ia : modelInstance;
|
|
152459
152457
|
const consumption = ai.modelUsage;
|
|
152460
|
-
const modelInfo = ai.getModelInfo();
|
|
152461
152458
|
const skillLogger = require('@digipair/skill-logger');
|
|
152462
|
-
await skillLogger.addConsumption(context,
|
|
152459
|
+
await skillLogger.addConsumption(context, ai.name, ai.defaults.model, consumption.promptTokens, consumption.completionTokens);
|
|
152463
152460
|
return result;
|
|
152464
152461
|
}
|
|
152465
152462
|
};
|
package/package.json
CHANGED
package/schema.fr.json
CHANGED
|
@@ -303,6 +303,15 @@
|
|
|
303
303
|
"$ref": "#/components/schemas/Function"
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "options",
|
|
309
|
+
"summary": "Options",
|
|
310
|
+
"required": false,
|
|
311
|
+
"description": "Options de génération",
|
|
312
|
+
"schema": {
|
|
313
|
+
"type": "object"
|
|
314
|
+
}
|
|
306
315
|
}
|
|
307
316
|
],
|
|
308
317
|
"x-events": []
|
|
@@ -384,6 +393,15 @@
|
|
|
384
393
|
"$ref": "https://schemas.digipair.ai/pinsSettings"
|
|
385
394
|
}
|
|
386
395
|
}
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"name": "options",
|
|
399
|
+
"summary": "Options",
|
|
400
|
+
"required": false,
|
|
401
|
+
"description": "Options de génération",
|
|
402
|
+
"schema": {
|
|
403
|
+
"type": "object"
|
|
404
|
+
}
|
|
387
405
|
}
|
|
388
406
|
],
|
|
389
407
|
"x-events": []
|
package/schema.json
CHANGED
|
@@ -303,6 +303,15 @@
|
|
|
303
303
|
"$ref": "#/components/schemas/Function"
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "options",
|
|
309
|
+
"summary": "Options",
|
|
310
|
+
"required": false,
|
|
311
|
+
"description": "Generation options",
|
|
312
|
+
"schema": {
|
|
313
|
+
"type": "object"
|
|
314
|
+
}
|
|
306
315
|
}
|
|
307
316
|
],
|
|
308
317
|
"x-events": []
|
|
@@ -384,6 +393,15 @@
|
|
|
384
393
|
"$ref": "https://schemas.digipair.ai/pinsSettings"
|
|
385
394
|
}
|
|
386
395
|
}
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"name": "options",
|
|
399
|
+
"summary": "Options",
|
|
400
|
+
"required": false,
|
|
401
|
+
"description": "Generation options",
|
|
402
|
+
"schema": {
|
|
403
|
+
"type": "object"
|
|
404
|
+
}
|
|
387
405
|
}
|
|
388
406
|
],
|
|
389
407
|
"x-events": []
|