@promptbook/website-crawler 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
@@ -29,7 +29,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
29
29
  * @generated
30
30
  * @see https://github.com/webgptorg/promptbook
31
31
  */
32
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-30';
32
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-32';
33
33
  /**
34
34
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
35
35
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -2959,23 +2959,17 @@ class MultipleLlmExecutionTools {
2959
2959
  * Check the configuration of all execution tools
2960
2960
  */
2961
2961
  async checkConfiguration() {
2962
- // TODO: Maybe do it in parallel
2963
- for (const llmExecutionTools of this.llmExecutionTools) {
2964
- await llmExecutionTools.checkConfiguration();
2965
- }
2962
+ // Note: Run checks in parallel
2963
+ await Promise.all(this.llmExecutionTools.map((tools) => tools.checkConfiguration()));
2966
2964
  }
2967
2965
  /**
2968
2966
  * List all available models that can be used
2969
2967
  * This lists is a combination of all available models from all execution tools
2970
2968
  */
2971
2969
  async listModels() {
2972
- const availableModels = [];
2973
- for (const llmExecutionTools of this.llmExecutionTools) {
2974
- // TODO: [🪂] Obtain models in parallel
2975
- const models = await llmExecutionTools.listModels();
2976
- availableModels.push(...models);
2977
- }
2978
- return availableModels;
2970
+ // Obtain all models in parallel and flatten
2971
+ const modelArrays = await Promise.all(this.llmExecutionTools.map((tools) => tools.listModels()));
2972
+ return modelArrays.flat();
2979
2973
  }
2980
2974
  /**
2981
2975
  * Calls the best available chat model