@promptbook/documents 0.84.0-15 โ 0.84.0-17
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 +10 -3
- package/esm/index.es.js +22 -15
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/cli.index.d.ts +4 -0
- package/esm/typings/src/_packages/core.index.d.ts +4 -0
- package/esm/typings/src/_packages/deepseek.index.d.ts +8 -0
- package/esm/typings/src/_packages/types.index.d.ts +2 -0
- package/esm/typings/src/_packages/wizzard.index.d.ts +4 -0
- package/esm/typings/src/config.d.ts +6 -0
- package/esm/typings/src/conversion/compilePipelineOnRemoteServer.d.ts +1 -1
- package/esm/typings/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +9 -0
- package/esm/typings/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +14 -0
- package/esm/typings/src/llm-providers/deepseek/register-configuration.d.ts +14 -0
- package/esm/typings/src/llm-providers/deepseek/register-constructor.d.ts +15 -0
- package/esm/typings/src/prepare/preparePipelineOnRemoteServer.d.ts +1 -1
- package/esm/typings/src/remote-server/socket-types/_subtypes/PromptbookServer_Identification.d.ts +5 -2
- package/package.json +6 -4
- package/umd/index.umd.js +22 -15
- package/umd/index.umd.js.map +1 -1
- package/LICENSE.md +0 -1
package/README.md
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## ๐ New Features
|
|
18
18
|
|
|
19
|
-
- ๐ **Support of [DeepSeek models](https://www.
|
|
19
|
+
- ๐ **Support of [DeepSeek models](https://www.npmjs.com/package/@promptbook/deepseek)**
|
|
20
20
|
- ๐ Working [the **Book** language v1.0.0](https://github.com/webgptorg/book)
|
|
21
21
|
- ๐ค Run books from CLI - `npx ptbk run path/to/your/book`
|
|
22
22
|
- ๐ Support of `.docx`, `.doc` and `.pdf` documents as knowledge
|
|
@@ -266,8 +266,9 @@ Or you can install them separately:
|
|
|
266
266
|
- **[@promptbook/anthropic-claude](https://www.npmjs.com/package/@promptbook/anthropic-claude)** - Execution tools for Anthropic Claude API, wrapper around Anthropic Claude SDK
|
|
267
267
|
- **[@promptbook/vercel](https://www.npmjs.com/package/@promptbook/vercel)** - Adapter for Vercel functionalities
|
|
268
268
|
- **[@promptbook/google](https://www.npmjs.com/package/@promptbook/google)** - Integration with Google's Gemini API
|
|
269
|
+
- **[@promptbook/deepseek](https://www.npmjs.com/package/@promptbook/deepseek)** - Integration with [DeepSeek API](https://www.deepseek.com/)
|
|
269
270
|
- **[@promptbook/azure-openai](https://www.npmjs.com/package/@promptbook/azure-openai)** - Execution tools for Azure OpenAI API
|
|
270
|
-
|
|
271
|
+
|
|
271
272
|
- **[@promptbook/fake-llm](https://www.npmjs.com/package/@promptbook/fake-llm)** - Mocked execution tools for testing the library and saving the tokens
|
|
272
273
|
- **[@promptbook/remote-client](https://www.npmjs.com/package/@promptbook/remote-client)** - Remote client for remote execution of promptbooks
|
|
273
274
|
- **[@promptbook/remote-server](https://www.npmjs.com/package/@promptbook/remote-server)** - Remote server for remote execution of promptbooks
|
|
@@ -437,6 +438,12 @@ See [TODO.md](./TODO.md)
|
|
|
437
438
|
|
|
438
439
|
|
|
439
440
|
|
|
441
|
+
|
|
442
|
+
## ๐ค Partners
|
|
443
|
+
|
|
444
|
+
[](https://technologickainkubace.org/en/about-technology-incubation/about-the-project/)
|
|
445
|
+
|
|
446
|
+
|
|
440
447
|
## ๐๏ธ Contributing
|
|
441
448
|
|
|
442
449
|
I am open to pull requests, feedback, and suggestions. Or if you like this utility, you can [โ buy me a coffee](https://www.buymeacoffee.com/hejny) or [donate via cryptocurrencies](https://github.com/hejny/hejny/blob/main/documents/crypto.md).
|
package/esm/index.es.js
CHANGED
|
@@ -26,7 +26,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
26
26
|
* @generated
|
|
27
27
|
* @see https://github.com/webgptorg/promptbook
|
|
28
28
|
*/
|
|
29
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.84.0-
|
|
29
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.84.0-16';
|
|
30
30
|
/**
|
|
31
31
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
32
32
|
* Note: [๐] Ignore a discrepancy between file name and entity name
|
|
@@ -197,6 +197,12 @@ var ADMIN_GITHUB_NAME = 'hejny';
|
|
|
197
197
|
* @public exported from `@promptbook/core`
|
|
198
198
|
*/
|
|
199
199
|
var DEFAULT_BOOK_TITLE = "\u2728 Untitled Book";
|
|
200
|
+
/**
|
|
201
|
+
* Maximum file size limit
|
|
202
|
+
*
|
|
203
|
+
* @public exported from `@promptbook/core`
|
|
204
|
+
*/
|
|
205
|
+
var DEFAULT_MAX_FILE_SIZE = 100 * 1024 * 1024; // 100MB
|
|
200
206
|
// <- TODO: [๐ง ] Better system for generator warnings - not always "code" and "by `@promptbook/cli`"
|
|
201
207
|
/**
|
|
202
208
|
* The maximum number of iterations for a loops
|
|
@@ -3777,11 +3783,10 @@ var scraperFetch = function (url, init) { return __awaiter(void 0, void 0, void
|
|
|
3777
3783
|
function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
3778
3784
|
var _a;
|
|
3779
3785
|
return __awaiter(this, void 0, void 0, function () {
|
|
3780
|
-
var _b, fetch, knowledgeSourceContent, name, _c, _d, rootDirname, url, response_1, mimeType, basename, hash, rootDirname_1, filepath, _f, _g,
|
|
3781
|
-
return __generator(this, function (
|
|
3782
|
-
switch (
|
|
3786
|
+
var _b, fetch, knowledgeSourceContent, name, _c, _d, rootDirname, url, response_1, mimeType, basename, hash, rootDirname_1, filepath, fileContent, _f, _g, filename_1, fileExtension, mimeType;
|
|
3787
|
+
return __generator(this, function (_h) {
|
|
3788
|
+
switch (_h.label) {
|
|
3783
3789
|
case 0:
|
|
3784
|
-
console.log('!!! makeKnowledgeSourceHandler', knowledgeSource);
|
|
3785
3790
|
_b = tools.fetch, fetch = _b === void 0 ? scraperFetch : _b;
|
|
3786
3791
|
knowledgeSourceContent = knowledgeSource.knowledgeSourceContent;
|
|
3787
3792
|
name = knowledgeSource.name;
|
|
@@ -3793,7 +3798,7 @@ function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
3793
3798
|
url = knowledgeSourceContent;
|
|
3794
3799
|
return [4 /*yield*/, fetch(url)];
|
|
3795
3800
|
case 1:
|
|
3796
|
-
response_1 =
|
|
3801
|
+
response_1 = _h.sent();
|
|
3797
3802
|
mimeType = ((_a = response_1.headers.get('content-type')) === null || _a === void 0 ? void 0 : _a.split(';')[0]) || 'text/html';
|
|
3798
3803
|
if (tools.fs === undefined || !url.endsWith('.pdf' /* <- TODO: [๐ต] */)) {
|
|
3799
3804
|
return [2 /*return*/, {
|
|
@@ -3843,17 +3848,19 @@ function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
3843
3848
|
filepath = join.apply(void 0, __spreadArray(__spreadArray([], __read(nameToSubfolderPath(hash /* <- TODO: [๐] Maybe add some SHA256 prefix */)), false), ["".concat(basename.substring(0, MAX_FILENAME_LENGTH), ".").concat(mimeTypeToExtension(mimeType))], false));
|
|
3844
3849
|
return [4 /*yield*/, tools.fs.mkdir(dirname(join(rootDirname_1, filepath)), { recursive: true })];
|
|
3845
3850
|
case 2:
|
|
3846
|
-
|
|
3847
|
-
_g = (_f =
|
|
3848
|
-
_h = [join(rootDirname_1, filepath)];
|
|
3849
|
-
_k = (_j = Buffer).from;
|
|
3851
|
+
_h.sent();
|
|
3852
|
+
_g = (_f = Buffer).from;
|
|
3850
3853
|
return [4 /*yield*/, response_1.arrayBuffer()];
|
|
3851
|
-
case 3:
|
|
3854
|
+
case 3:
|
|
3855
|
+
fileContent = _g.apply(_f, [_h.sent()]);
|
|
3856
|
+
if (fileContent.length > DEFAULT_MAX_FILE_SIZE /* <- TODO: Allow to pass different value to remote server */) {
|
|
3857
|
+
throw new LimitReachedError("File is too large (".concat(Math.round(fileContent.length / 1024 / 1024), "MB). Maximum allowed size is ").concat(Math.round(DEFAULT_MAX_FILE_SIZE / 1024 / 1024), "MB."));
|
|
3858
|
+
}
|
|
3859
|
+
return [4 /*yield*/, tools.fs.writeFile(join(rootDirname_1, filepath), fileContent)];
|
|
3852
3860
|
case 4:
|
|
3853
|
-
|
|
3861
|
+
_h.sent();
|
|
3854
3862
|
// TODO: [๐ต] Check the file security
|
|
3855
|
-
// TODO:
|
|
3856
|
-
// TODO: !!!!!!!! Delete the file after the scraping is done
|
|
3863
|
+
// TODO: [๐งน][๐ง ] Delete the file after the scraping is done
|
|
3857
3864
|
return [2 /*return*/, makeKnowledgeSourceHandler({ name: name, knowledgeSourceContent: filepath }, tools, __assign(__assign({}, options), { rootDirname: rootDirname_1 }))];
|
|
3858
3865
|
case 5:
|
|
3859
3866
|
if (!isValidFilePath(knowledgeSourceContent)) return [3 /*break*/, 7];
|
|
@@ -3870,7 +3877,7 @@ function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
3870
3877
|
mimeType = extensionToMimeType(fileExtension || '');
|
|
3871
3878
|
return [4 /*yield*/, isFileExisting(filename_1, tools.fs)];
|
|
3872
3879
|
case 6:
|
|
3873
|
-
if (!(
|
|
3880
|
+
if (!(_h.sent())) {
|
|
3874
3881
|
throw new NotFoundError(spaceTrim$1(function (block) { return "\n Can not make source handler for file which does not exist:\n\n File:\n ".concat(block(knowledgeSourceContent), "\n\n Full file path:\n ").concat(block(filename_1), "\n "); }));
|
|
3875
3882
|
}
|
|
3876
3883
|
// TODO: [๐ง ][๐ฟ] Test security file - file is scoped to the project (BUT maybe do this in `filesystemTools`)
|