@promptbook/wizard 0.100.0-2 → 0.100.0-3

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/esm/index.es.js CHANGED
@@ -38,7 +38,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
38
38
  * @generated
39
39
  * @see https://github.com/webgptorg/promptbook
40
40
  */
41
- const PROMPTBOOK_ENGINE_VERSION = '0.100.0-2';
41
+ const PROMPTBOOK_ENGINE_VERSION = '0.100.0-3';
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
@@ -16906,14 +16906,14 @@ class Wizard {
16906
16906
  *
16907
16907
  * Note: This works similar to the `ptbk run` command
16908
16908
  */
16909
- async execute(book, inputParameters) {
16909
+ async execute(book, inputParameters, options = {}) {
16910
16910
  if (!$isRunningInNode()) {
16911
16911
  throw new EnvironmentMismatchError('Wizard works only in Node.js environment');
16912
16912
  }
16913
16913
  // ▶ Get the tools
16914
- const tools = await this.getExecutionTools();
16914
+ const tools = await this.getExecutionTools(options);
16915
16915
  // ▶ Get the Pipeline
16916
- const pipeline = await this.getCompiledBook(book);
16916
+ const pipeline = await this.getCompiledBook(book, options);
16917
16917
  // ▶ Create executor - the function that will execute the Pipeline
16918
16918
  const pipelineExecutor = createPipelineExecutor({ pipeline, tools });
16919
16919
  // 🚀▶ Execute the Pipeline
@@ -16936,15 +16936,16 @@ class Wizard {
16936
16936
  /**
16937
16937
  * Provides the tools automatically for the Node.js environment
16938
16938
  *
16939
- * @param pipelineSource
16939
+ * @param options
16940
16940
  */
16941
- async getExecutionTools() {
16941
+ async getExecutionTools(options = {}) {
16942
+ var _a;
16942
16943
  if (this.executionTools !== null) {
16943
16944
  return this.executionTools;
16944
16945
  }
16945
16946
  // TODO: DRY [◽]
16946
16947
  const prepareAndScrapeOptions = {
16947
- isVerbose: false,
16948
+ isVerbose: (_a = options.isVerbose) !== null && _a !== void 0 ? _a : false,
16948
16949
  isCacheReloaded: false, // <- TODO: Allow to pass
16949
16950
  }; /* <- TODO: ` satisfies PrepareAndScrapeOptions` */
16950
16951
  const fs = $provideFilesystemForNode();
@@ -16974,9 +16975,10 @@ class Wizard {
16974
16975
  * 3) As a string
16975
16976
  *
16976
16977
  * @param pipelineSource
16978
+ * @param options
16977
16979
  */
16978
- async getCompiledBook(pipelineSource) {
16979
- const tools = await this.getExecutionTools();
16980
+ async getCompiledBook(pipelineSource, options = {}) {
16981
+ const tools = await this.getExecutionTools(options);
16980
16982
  return /* not await */ $getCompiledBook(tools, pipelineSource);
16981
16983
  }
16982
16984
  }