@promptbook/legacy-documents 0.92.0-31 → 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
@@ -28,7 +28,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
28
28
  * @generated
29
29
  * @see https://github.com/webgptorg/promptbook
30
30
  */
31
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-31';
31
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-32';
32
32
  /**
33
33
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
34
34
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -3004,23 +3004,17 @@ class MultipleLlmExecutionTools {
3004
3004
  * Check the configuration of all execution tools
3005
3005
  */
3006
3006
  async checkConfiguration() {
3007
- // TODO: Maybe do it in parallel
3008
- for (const llmExecutionTools of this.llmExecutionTools) {
3009
- await llmExecutionTools.checkConfiguration();
3010
- }
3007
+ // Note: Run checks in parallel
3008
+ await Promise.all(this.llmExecutionTools.map((tools) => tools.checkConfiguration()));
3011
3009
  }
3012
3010
  /**
3013
3011
  * List all available models that can be used
3014
3012
  * This lists is a combination of all available models from all execution tools
3015
3013
  */
3016
3014
  async listModels() {
3017
- const availableModels = [];
3018
- for (const llmExecutionTools of this.llmExecutionTools) {
3019
- // TODO: [🪂] Obtain models in parallel
3020
- const models = await llmExecutionTools.listModels();
3021
- availableModels.push(...models);
3022
- }
3023
- return availableModels;
3015
+ // Obtain all models in parallel and flatten
3016
+ const modelArrays = await Promise.all(this.llmExecutionTools.map((tools) => tools.listModels()));
3017
+ return modelArrays.flat();
3024
3018
  }
3025
3019
  /**
3026
3020
  * Calls the best available chat model