@promptbook/cli 0.84.0-14 → 0.84.0-16

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/LICENSE.md ADDED
@@ -0,0 +1 @@
1
+ [Functional Source License, Version 1.1, ALv2 Future License](https://github.com/getsentry/fsl.software/blob/main/FSL-1.1-ALv2.template.md)
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <!-- ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten -->
2
2
 
3
- # Promptbook
3
+ # Promptbook
4
4
 
5
5
 
6
6
 
@@ -14,12 +14,12 @@
14
14
 
15
15
 
16
16
 
17
- ## New Features
17
+ ## 🌟 New Features
18
18
 
19
+ - 🐋 **Support of [DeepSeek models](https://www.deepseek.com/)**
19
20
  - 💙 Working [the **Book** language v1.0.0](https://github.com/webgptorg/book)
20
21
  - 🖤 Run books from CLI - `npx ptbk run path/to/your/book`
21
- - 📚 Support of `.docx`, `.doc` and `.pdf` documents
22
- - ✨ **Support of [OpenAI o1 model](https://openai.com/o1/)**
22
+ - 📚 Support of `.docx`, `.doc` and `.pdf` documents as knowledge
23
23
 
24
24
 
25
25
 
@@ -320,8 +320,9 @@ Or you can install them separately:
320
320
  - **[@promptbook/anthropic-claude](https://www.npmjs.com/package/@promptbook/anthropic-claude)** - Execution tools for Anthropic Claude API, wrapper around Anthropic Claude SDK
321
321
  - **[@promptbook/vercel](https://www.npmjs.com/package/@promptbook/vercel)** - Adapter for Vercel functionalities
322
322
  - **[@promptbook/google](https://www.npmjs.com/package/@promptbook/google)** - Integration with Google's Gemini API
323
+ - **[@promptbook/deepseek](https://www.npmjs.com/package/@promptbook/deepseek)** - Integration with [DeepSeek API](https://www.deepseek.com/)
323
324
  - **[@promptbook/azure-openai](https://www.npmjs.com/package/@promptbook/azure-openai)** - Execution tools for Azure OpenAI API
324
- - **[@promptbook/langtail](https://www.npmjs.com/package/@promptbook/langtail)** - Execution tools for Langtail API, wrapper around Langtail SDK
325
+
325
326
  - **[@promptbook/fake-llm](https://www.npmjs.com/package/@promptbook/fake-llm)** - Mocked execution tools for testing the library and saving the tokens
326
327
  - **[@promptbook/remote-client](https://www.npmjs.com/package/@promptbook/remote-client)** - Remote client for remote execution of promptbooks
327
328
  - **[@promptbook/remote-server](https://www.npmjs.com/package/@promptbook/remote-server)** - Remote server for remote execution of promptbooks
package/esm/index.es.js CHANGED
@@ -38,7 +38,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
38
38
  * @generated
39
39
  * @see https://github.com/webgptorg/promptbook
40
40
  */
41
- var PROMPTBOOK_ENGINE_VERSION = '0.84.0-13';
41
+ var PROMPTBOOK_ENGINE_VERSION = '0.84.0-15';
42
42
  /**
43
43
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
44
44
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -15058,16 +15058,16 @@ var _AzureOpenAiRegistration = $llmToolsRegister.register(createAzureOpenAiExecu
15058
15058
  * @public exported from `@promptbook/wizzard`
15059
15059
  * @public exported from `@promptbook/cli`
15060
15060
  */
15061
- var _GoogleMetadataRegistration = $llmToolsMetadataRegister.register({
15062
- title: 'Google Gemini',
15063
- packageName: '@promptbook/google',
15064
- className: 'GoogleExecutionTools',
15065
- envVariables: ['GOOGLE_GENERATIVE_AI_API_KEY'],
15061
+ var _DeepseekMetadataRegistration = $llmToolsMetadataRegister.register({
15062
+ title: 'Deepseek',
15063
+ packageName: '@promptbook/deepseek',
15064
+ className: 'DeepseekExecutionTools',
15065
+ envVariables: ['DEEPSEEK_GENERATIVE_AI_API_KEY'],
15066
15066
  getBoilerplateConfiguration: function () {
15067
15067
  return {
15068
- title: 'Google Gemini (boilerplate)',
15069
- packageName: '@promptbook/google',
15070
- className: 'GoogleExecutionTools',
15068
+ title: 'Deepseek (boilerplate)',
15069
+ packageName: '@promptbook/deepseek',
15070
+ className: 'DeepseekExecutionTools',
15071
15071
  options: {
15072
15072
  apiKey: 'AI',
15073
15073
  },
@@ -15077,17 +15077,17 @@ var _GoogleMetadataRegistration = $llmToolsMetadataRegister.register({
15077
15077
  if ($isRunningInJest()
15078
15078
  // <- TODO: Maybe check `env.JEST_WORKER_ID` directly here or pass `env` into `$isRunningInJest`
15079
15079
  ) {
15080
- // Note: [🔘] Gemini makes problems in Jest environment
15080
+ // Note: [🔘] Maybe same problem as Gemini
15081
15081
  return null;
15082
15082
  }
15083
15083
  // Note: Note using `process.env` BUT `env` to pass in the environment variables dynamically
15084
- if (typeof env.GOOGLE_GENERATIVE_AI_API_KEY === 'string') {
15084
+ if (typeof env.DEEPSEEK_GENERATIVE_AI_API_KEY === 'string') {
15085
15085
  return {
15086
- title: 'Google Gemini (from env)',
15087
- packageName: '@promptbook/google',
15088
- className: 'GoogleExecutionTools',
15086
+ title: 'Deepseek (from env)',
15087
+ packageName: '@promptbook/deepseek',
15088
+ className: 'DeepseekExecutionTools',
15089
15089
  options: {
15090
- apiKey: env.GOOGLE_GENERATIVE_AI_API_KEY,
15090
+ apiKey: env.DEEPSEEK_GENERATIVE_AI_API_KEY,
15091
15091
  },
15092
15092
  };
15093
15093
  }
@@ -15268,6 +15268,98 @@ function createExecutionToolsFromVercelProvider(options) {
15268
15268
  };
15269
15269
  }
15270
15270
 
15271
+ /**
15272
+ * Execution Tools for calling Deepseek API.
15273
+ *
15274
+ * @public exported from `@promptbook/deepseek`
15275
+ */
15276
+ var createDeepseekExecutionTools = Object.assign(function (options) {
15277
+ if ($isRunningInJest()) {
15278
+ // Note: [🔘]
15279
+ throw new Error('DeepseekExecutionTools are not supported in Jest environment');
15280
+ }
15281
+ // Note: [🔘] Maybe there is same compatibility problem as in '@ai-sdk/deepseek'
15282
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
15283
+ var createDeepSeek = require('@ai-sdk/deepseek').createDeepSeek;
15284
+ var deepseekVercelProvider = createDeepSeek(__assign({}, options));
15285
+ return createExecutionToolsFromVercelProvider(__assign({ title: 'Deepseek', description: 'Implementation of Deepseek models', vercelProvider: deepseekVercelProvider, availableModels: [
15286
+ // TODO: [🕘] Maybe list models in same way as in other providers - in separate file with metadata
15287
+ 'deepseek-chat',
15288
+ 'deepseek-reasoner',
15289
+ // <- TODO: !!!!!! Picking of default model
15290
+ ].map(function (modelName) { return ({ modelName: modelName, modelVariant: 'CHAT' }); }) }, options));
15291
+ }, {
15292
+ packageName: '@promptbook/deepseek',
15293
+ className: 'DeepseekExecutionTools',
15294
+ });
15295
+ /**
15296
+ * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
15297
+ */
15298
+
15299
+ /**
15300
+ * Registration of LLM provider
15301
+ *
15302
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
15303
+ *
15304
+ * @public exported from `@promptbook/deepseek`
15305
+ * @public exported from `@promptbook/wizzard`
15306
+ * @public exported from `@promptbook/cli`
15307
+ */
15308
+ var _DeepseekRegistration = $llmToolsRegister.register(createDeepseekExecutionTools);
15309
+ /**
15310
+ * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
15311
+ * Note: [💞] Ignore a discrepancy between file name and entity name
15312
+ */
15313
+
15314
+ /**
15315
+ * Registration of LLM provider metadata
15316
+ *
15317
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
15318
+ *
15319
+ * @public exported from `@promptbook/core`
15320
+ * @public exported from `@promptbook/wizzard`
15321
+ * @public exported from `@promptbook/cli`
15322
+ */
15323
+ var _GoogleMetadataRegistration = $llmToolsMetadataRegister.register({
15324
+ title: 'Google Gemini',
15325
+ packageName: '@promptbook/google',
15326
+ className: 'GoogleExecutionTools',
15327
+ envVariables: ['GOOGLE_GENERATIVE_AI_API_KEY'],
15328
+ getBoilerplateConfiguration: function () {
15329
+ return {
15330
+ title: 'Google Gemini (boilerplate)',
15331
+ packageName: '@promptbook/google',
15332
+ className: 'GoogleExecutionTools',
15333
+ options: {
15334
+ apiKey: 'AI',
15335
+ },
15336
+ };
15337
+ },
15338
+ createConfigurationFromEnv: function (env) {
15339
+ if ($isRunningInJest()
15340
+ // <- TODO: Maybe check `env.JEST_WORKER_ID` directly here or pass `env` into `$isRunningInJest`
15341
+ ) {
15342
+ // Note: [🔘] Gemini makes problems in Jest environment
15343
+ return null;
15344
+ }
15345
+ // Note: Note using `process.env` BUT `env` to pass in the environment variables dynamically
15346
+ if (typeof env.GOOGLE_GENERATIVE_AI_API_KEY === 'string') {
15347
+ return {
15348
+ title: 'Google Gemini (from env)',
15349
+ packageName: '@promptbook/google',
15350
+ className: 'GoogleExecutionTools',
15351
+ options: {
15352
+ apiKey: env.GOOGLE_GENERATIVE_AI_API_KEY,
15353
+ },
15354
+ };
15355
+ }
15356
+ return null;
15357
+ },
15358
+ });
15359
+ /**
15360
+ * Note: [💞] Ignore a discrepancy between file name and entity name
15361
+ */
15362
+
15271
15363
  /**
15272
15364
  * Execution Tools for calling Google Gemini API.
15273
15365
  *
@@ -17017,10 +17109,10 @@ var MarkitdownScraper = /** @class */ (function () {
17017
17109
  this.tools = tools;
17018
17110
  this.options = options;
17019
17111
  this.markdownScraper = new MarkdownScraper(tools, options);
17112
+ // Note: Module `markitdown-ts` has no types available, so it is imported using `require`
17020
17113
  // eslint-disable-next-line @typescript-eslint/no-var-requires
17021
17114
  var MarkItDown = require('markitdown-ts').MarkItDown;
17022
- // <- TODO: !!! Use Markitdown directly not through this package
17023
- // <- Note: !!!!!!!
17115
+ // <- TODO: 'Use Markitdown directly not through this package
17024
17116
  this.markitdown = new MarkItDown();
17025
17117
  }
17026
17118
  Object.defineProperty(MarkitdownScraper.prototype, "metadata", {
@@ -17065,12 +17157,12 @@ var MarkitdownScraper = /** @class */ (function () {
17065
17157
  case 2:
17066
17158
  if (!!(_f.sent())) return [3 /*break*/, 5];
17067
17159
  src = source.filename || source.url || null;
17068
- console.log('!!!', { src: src, source: source, cacheFilehandler: cacheFilehandler });
17160
+ // console.log('!!!', { src, source, cacheFilehandler });
17069
17161
  if (src === null) {
17070
17162
  throw new UnexpectedError('Source has no filename or url');
17071
17163
  }
17072
17164
  return [4 /*yield*/, this.markitdown.convert(src, {
17073
- // TODO: !!!!!! Pass when sacraping Youtube
17165
+ // TODO: Pass when sacraping Youtube
17074
17166
  // enableYoutubeTranscript: true,
17075
17167
  // youtubeTranscriptLanguage: 'en',
17076
17168
  })];
@@ -17080,9 +17172,10 @@ var MarkitdownScraper = /** @class */ (function () {
17080
17172
  throw new Error("Markitdown could not convert the \"".concat(source.source, "\""));
17081
17173
  // <- TODO: !!! Make MarkitdownError
17082
17174
  }
17083
- console.log('!!!', { result: result, cacheFilehandler: cacheFilehandler });
17175
+ // console.log('!!!', { result, cacheFilehandler });
17084
17176
  return [4 /*yield*/, this.tools.fs.writeFile(cacheFilehandler.filename, result.text_content)];
17085
17177
  case 4:
17178
+ // console.log('!!!', { result, cacheFilehandler });
17086
17179
  _f.sent();
17087
17180
  _f.label = 5;
17088
17181
  case 5: return [2 /*return*/, cacheFilehandler];
@@ -17500,5 +17593,5 @@ var _WebsiteScraperRegistration = $scrapersRegister.register(createWebsiteScrape
17500
17593
  * Note: [💞] Ignore a discrepancy between file name and entity name
17501
17594
  */
17502
17595
 
17503
- export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION, _AnthropicClaudeMetadataRegistration, _AnthropicClaudeRegistration, _AzureOpenAiMetadataRegistration, _AzureOpenAiRegistration, _BoilerplateScraperMetadataRegistration, _BoilerplateScraperRegistration, _CLI, _DocumentScraperMetadataRegistration, _DocumentScraperRegistration, _GoogleMetadataRegistration, _GoogleRegistration, _LegacyDocumentScraperMetadataRegistration, _LegacyDocumentScraperRegistration, _MarkdownScraperMetadataRegistration, _MarkdownScraperRegistration, _MarkitdownScraperMetadataRegistration, _MarkitdownScraperRegistration, _OpenAiAssistantMetadataRegistration, _OpenAiAssistantRegistration, _OpenAiMetadataRegistration, _OpenAiRegistration, _PdfScraperMetadataRegistration, _PdfScraperRegistration, _WebsiteScraperMetadataRegistration, _WebsiteScraperRegistration };
17596
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION, _AnthropicClaudeMetadataRegistration, _AnthropicClaudeRegistration, _AzureOpenAiMetadataRegistration, _AzureOpenAiRegistration, _BoilerplateScraperMetadataRegistration, _BoilerplateScraperRegistration, _CLI, _DeepseekMetadataRegistration, _DeepseekRegistration, _DocumentScraperMetadataRegistration, _DocumentScraperRegistration, _GoogleMetadataRegistration, _GoogleRegistration, _LegacyDocumentScraperMetadataRegistration, _LegacyDocumentScraperRegistration, _MarkdownScraperMetadataRegistration, _MarkdownScraperRegistration, _MarkitdownScraperMetadataRegistration, _MarkitdownScraperRegistration, _OpenAiAssistantMetadataRegistration, _OpenAiAssistantRegistration, _OpenAiMetadataRegistration, _OpenAiRegistration, _PdfScraperMetadataRegistration, _PdfScraperRegistration, _WebsiteScraperMetadataRegistration, _WebsiteScraperRegistration };
17504
17597
  //# sourceMappingURL=index.es.js.map