@digipair/skill-llm 0.112.3 → 0.114.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/README.md +7 -0
- package/{api_chain.esm.js → dist/api_chain.esm.js} +1 -1
- package/{few_shot.cjs.js → dist/few_shot.cjs.js} +1 -7
- package/{few_shot.esm.js → dist/few_shot.esm.js} +1 -7
- package/{index.cjs.js → dist/index.cjs.js} +0 -2
- package/{index.cjs2.js → dist/index.cjs2.js} +75108 -42045
- package/dist/index.esm.js +1 -0
- package/{index.esm2.js → dist/index.esm2.js} +119769 -88142
- package/{sequential_chain.cjs.js → dist/sequential_chain.cjs.js} +3 -4
- package/{sequential_chain.esm.js → dist/sequential_chain.esm.js} +4 -5
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/{libs/skill-llm → dist}/src/lib/skill-llm.d.ts +1 -0
- package/dist/src/lib/skill-llm.d.ts.map +1 -0
- package/{vector_db_qa.cjs.js → dist/vector_db_qa.cjs.js} +3 -10
- package/{vector_db_qa.esm.js → dist/vector_db_qa.esm.js} +1 -8
- package/package.json +28 -5
- package/chat.cjs.js +0 -2418
- package/chat.esm.js +0 -2413
- package/index.d.ts +0 -1
- package/index.esm.js +0 -1
- package/libs/skill-llm/src/index.d.ts +0 -1
- /package/{api_chain.cjs.js → dist/api_chain.cjs.js} +0 -0
- /package/{index.cjs.d.ts → dist/index.d.ts} +0 -0
- /package/{schema.fr.json → dist/schema.fr.json} +0 -0
- /package/{schema.json → dist/schema.json} +0 -0
|
@@ -337,12 +337,12 @@ function formatSet(input) {
|
|
|
337
337
|
* const overallChain = new SequentialChain({
|
|
338
338
|
* chains: [
|
|
339
339
|
* new LLMChain({
|
|
340
|
-
* llm: new ChatOpenAI({ temperature: 0 }),
|
|
340
|
+
* llm: new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0 }),
|
|
341
341
|
* prompt: promptTemplate,
|
|
342
342
|
* outputKey: "synopsis",
|
|
343
343
|
* }),
|
|
344
344
|
* new LLMChain({
|
|
345
|
-
* llm: new OpenAI({ temperature: 0 }),
|
|
345
|
+
* llm: new OpenAI({ model: "gpt-4o-mini", temperature: 0 }),
|
|
346
346
|
* prompt: reviewPromptTemplate,
|
|
347
347
|
* outputKey: "review",
|
|
348
348
|
* }),
|
|
@@ -850,8 +850,7 @@ function formatSet(input) {
|
|
|
850
850
|
var chain = _step.value;
|
|
851
851
|
if (chain.inputKeys.filter(function(k) {
|
|
852
852
|
var _chain_memory;
|
|
853
|
-
|
|
854
|
-
return (_ref = !((_chain_memory = chain.memory) === null || _chain_memory === void 0 ? void 0 : _chain_memory.memoryKeys.includes(k))) !== null && _ref !== void 0 ? _ref : true;
|
|
853
|
+
return !((_chain_memory = chain.memory) === null || _chain_memory === void 0 ? void 0 : _chain_memory.memoryKeys.includes(k));
|
|
855
854
|
}).length !== 1) {
|
|
856
855
|
throw new Error("Chains used in SimpleSequentialChain should all have one input, got ".concat(chain.inputKeys.length, " for ").concat(chain._chainType(), "."));
|
|
857
856
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as BaseChain } from './index.esm2.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#implementing_basic_set_operations
|
|
@@ -334,12 +334,12 @@ function formatSet(input) {
|
|
|
334
334
|
* const overallChain = new SequentialChain({
|
|
335
335
|
* chains: [
|
|
336
336
|
* new LLMChain({
|
|
337
|
-
* llm: new ChatOpenAI({ temperature: 0 }),
|
|
337
|
+
* llm: new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0 }),
|
|
338
338
|
* prompt: promptTemplate,
|
|
339
339
|
* outputKey: "synopsis",
|
|
340
340
|
* }),
|
|
341
341
|
* new LLMChain({
|
|
342
|
-
* llm: new OpenAI({ temperature: 0 }),
|
|
342
|
+
* llm: new OpenAI({ model: "gpt-4o-mini", temperature: 0 }),
|
|
343
343
|
* prompt: reviewPromptTemplate,
|
|
344
344
|
* outputKey: "review",
|
|
345
345
|
* }),
|
|
@@ -847,8 +847,7 @@ function formatSet(input) {
|
|
|
847
847
|
var chain = _step.value;
|
|
848
848
|
if (chain.inputKeys.filter(function(k) {
|
|
849
849
|
var _chain_memory;
|
|
850
|
-
|
|
851
|
-
return (_ref = !((_chain_memory = chain.memory) === null || _chain_memory === void 0 ? void 0 : _chain_memory.memoryKeys.includes(k))) !== null && _ref !== void 0 ? _ref : true;
|
|
850
|
+
return !((_chain_memory = chain.memory) === null || _chain_memory === void 0 ? void 0 : _chain_memory.memoryKeys.includes(k));
|
|
852
851
|
}).length !== 1) {
|
|
853
852
|
throw new Error("Chains used in SimpleSequentialChain should all have one input, got ".concat(chain.inputKeys.length, " for ").concat(chain._chainType(), "."));
|
|
854
853
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -7,3 +7,4 @@ export declare const reasoningStep: (params: any, pinsSettingsList: PinsSettings
|
|
|
7
7
|
export declare const basic: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<RunnableSequence<any, any>>;
|
|
8
8
|
export declare const vision: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<RunnableSequence<any, any>>;
|
|
9
9
|
export declare const summarization: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<RunnableSequence<any, any>>;
|
|
10
|
+
//# sourceMappingURL=skill-llm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-llm.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-llm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAmB,MAAM,kBAAkB,CAAC;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAuT7D,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACtB,CAAC;AAE7D,eAAO,MAAM,aAAa,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG;;EACtB,CAAC;AAEpE,eAAO,MAAM,KAAK,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,wCACtB,CAAC;AAE5D,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,wCACtB,CAAC;AAE7D,eAAO,MAAM,aAAa,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,wCACtB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index.cjs2.js');
|
|
4
|
-
var chat = require('./chat.cjs.js');
|
|
5
4
|
require('@digipair/engine');
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -66,7 +65,6 @@ function _defineProperties$1(target, props) {
|
|
|
66
65
|
}
|
|
67
66
|
function _create_class$1(Constructor, protoProps, staticProps) {
|
|
68
67
|
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
|
69
|
-
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
|
70
68
|
return Constructor;
|
|
71
69
|
}
|
|
72
70
|
function _get_prototype_of$1(o) {
|
|
@@ -373,10 +371,10 @@ var DEFAULT_QA_PROMPT = /*#__PURE__*/ new index.PromptTemplate({
|
|
|
373
371
|
});
|
|
374
372
|
var system_template = "Use the following pieces of context to answer the users question. \nIf you don't know the answer, just say that you don't know, don't try to make up an answer.\n----------------\n{context}";
|
|
375
373
|
var messages = [
|
|
376
|
-
/*#__PURE__*/
|
|
377
|
-
/*#__PURE__*/
|
|
374
|
+
/*#__PURE__*/ index.SystemMessagePromptTemplate.fromTemplate(system_template),
|
|
375
|
+
/*#__PURE__*/ index.HumanMessagePromptTemplate.fromTemplate("{question}")
|
|
378
376
|
];
|
|
379
|
-
var CHAT_PROMPT = /*#__PURE__*/
|
|
377
|
+
var CHAT_PROMPT = /*#__PURE__*/ index.ChatPromptTemplate.fromMessages(messages);
|
|
380
378
|
var QA_PROMPT_SELECTOR = /*#__PURE__*/ new ConditionalPromptSelector(DEFAULT_QA_PROMPT, [
|
|
381
379
|
[
|
|
382
380
|
isChatModel,
|
|
@@ -510,11 +508,6 @@ function ownKeys(object, enumerableOnly) {
|
|
|
510
508
|
var keys = Object.keys(object);
|
|
511
509
|
if (Object.getOwnPropertySymbols) {
|
|
512
510
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
513
|
-
if (enumerableOnly) {
|
|
514
|
-
symbols = symbols.filter(function(sym) {
|
|
515
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
511
|
keys.push.apply(keys, symbols);
|
|
519
512
|
}
|
|
520
513
|
return keys;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { P as PromptTemplate, L as LLMChain,
|
|
2
|
-
import { C as ChatPromptTemplate, S as SystemMessagePromptTemplate, H as HumanMessagePromptTemplate } from './chat.esm.js';
|
|
1
|
+
import { P as PromptTemplate, C as ChatPromptTemplate, S as SystemMessagePromptTemplate, H as HumanMessagePromptTemplate, L as LLMChain, d as StuffDocumentsChain, b as BaseChain } from './index.esm2.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Abstract class that defines the interface for selecting a prompt for a
|
|
@@ -63,7 +62,6 @@ function _defineProperties$1(target, props) {
|
|
|
63
62
|
}
|
|
64
63
|
function _create_class$1(Constructor, protoProps, staticProps) {
|
|
65
64
|
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
|
66
|
-
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
|
67
65
|
return Constructor;
|
|
68
66
|
}
|
|
69
67
|
function _get_prototype_of$1(o) {
|
|
@@ -507,11 +505,6 @@ function ownKeys(object, enumerableOnly) {
|
|
|
507
505
|
var keys = Object.keys(object);
|
|
508
506
|
if (Object.getOwnPropertySymbols) {
|
|
509
507
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
510
|
-
if (enumerableOnly) {
|
|
511
|
-
symbols = symbols.filter(function(sym) {
|
|
512
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
508
|
keys.push.apply(keys, symbols);
|
|
516
509
|
}
|
|
517
510
|
return keys;
|
package/package.json
CHANGED
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digipair/skill-llm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.114.1",
|
|
4
|
+
"main": "./dist/index.cjs.js",
|
|
5
|
+
"module": "./dist/index.esm.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
4
7
|
"keywords": [
|
|
5
8
|
"digipair",
|
|
6
9
|
"service",
|
|
7
10
|
"tool"
|
|
8
11
|
],
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.esm.js",
|
|
16
|
+
"default": "./dist/index.cjs.js"
|
|
17
|
+
},
|
|
18
|
+
"./index.esm.js": "./dist/index.esm.js",
|
|
19
|
+
"./index.esm2.js": "./dist/index.esm2.js",
|
|
20
|
+
"./index.cjs.js": "./dist/index.cjs.js",
|
|
21
|
+
"./index.cjs2.js": "./dist/index.cjs2.js",
|
|
22
|
+
"./package.json": "./package.json",
|
|
23
|
+
"./schema.json": "./dist/schema.json",
|
|
24
|
+
"./schema.fr.json": "./dist/schema.fr.json"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"README.md",
|
|
29
|
+
"package.json"
|
|
30
|
+
],
|
|
31
|
+
"nx": {
|
|
32
|
+
"name": "skill-llm"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {}
|
|
35
|
+
}
|