@promptbook/node 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
@@ -30,7 +30,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
30
30
  * @generated
31
31
  * @see https://github.com/webgptorg/promptbook
32
32
  */
33
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-30';
33
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-32';
34
34
  /**
35
35
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
36
36
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -2916,23 +2916,17 @@ class MultipleLlmExecutionTools {
2916
2916
  * Check the configuration of all execution tools
2917
2917
  */
2918
2918
  async checkConfiguration() {
2919
- // TODO: Maybe do it in parallel
2920
- for (const llmExecutionTools of this.llmExecutionTools) {
2921
- await llmExecutionTools.checkConfiguration();
2922
- }
2919
+ // Note: Run checks in parallel
2920
+ await Promise.all(this.llmExecutionTools.map((tools) => tools.checkConfiguration()));
2923
2921
  }
2924
2922
  /**
2925
2923
  * List all available models that can be used
2926
2924
  * This lists is a combination of all available models from all execution tools
2927
2925
  */
2928
2926
  async listModels() {
2929
- const availableModels = [];
2930
- for (const llmExecutionTools of this.llmExecutionTools) {
2931
- // TODO: [🪂] Obtain models in parallel
2932
- const models = await llmExecutionTools.listModels();
2933
- availableModels.push(...models);
2934
- }
2935
- return availableModels;
2927
+ // Obtain all models in parallel and flatten
2928
+ const modelArrays = await Promise.all(this.llmExecutionTools.map((tools) => tools.listModels()));
2929
+ return modelArrays.flat();
2936
2930
  }
2937
2931
  /**
2938
2932
  * Calls the best available chat model