@promptbook/pdf 0.92.0-30 → 0.92.0-32

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
@@ -26,7 +26,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
26
26
  * @generated
27
27
  * @see https://github.com/webgptorg/promptbook
28
28
  */
29
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-30';
29
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-32';
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
@@ -2843,23 +2843,17 @@ class MultipleLlmExecutionTools {
2843
2843
  * Check the configuration of all execution tools
2844
2844
  */
2845
2845
  async checkConfiguration() {
2846
- // TODO: Maybe do it in parallel
2847
- for (const llmExecutionTools of this.llmExecutionTools) {
2848
- await llmExecutionTools.checkConfiguration();
2849
- }
2846
+ // Note: Run checks in parallel
2847
+ await Promise.all(this.llmExecutionTools.map((tools) => tools.checkConfiguration()));
2850
2848
  }
2851
2849
  /**
2852
2850
  * List all available models that can be used
2853
2851
  * This lists is a combination of all available models from all execution tools
2854
2852
  */
2855
2853
  async listModels() {
2856
- const availableModels = [];
2857
- for (const llmExecutionTools of this.llmExecutionTools) {
2858
- // TODO: [🪂] Obtain models in parallel
2859
- const models = await llmExecutionTools.listModels();
2860
- availableModels.push(...models);
2861
- }
2862
- return availableModels;
2854
+ // Obtain all models in parallel and flatten
2855
+ const modelArrays = await Promise.all(this.llmExecutionTools.map((tools) => tools.listModels()));
2856
+ return modelArrays.flat();
2863
2857
  }
2864
2858
  /**
2865
2859
  * Calls the best available chat model