@promptbook/remote-server 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
@@ -33,7 +33,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
33
33
  * @generated
34
34
  * @see https://github.com/webgptorg/promptbook
35
35
  */
36
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-31';
36
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-32';
37
37
  /**
38
38
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
39
39
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -2781,23 +2781,17 @@ class MultipleLlmExecutionTools {
2781
2781
  * Check the configuration of all execution tools
2782
2782
  */
2783
2783
  async checkConfiguration() {
2784
- // TODO: Maybe do it in parallel
2785
- for (const llmExecutionTools of this.llmExecutionTools) {
2786
- await llmExecutionTools.checkConfiguration();
2787
- }
2784
+ // Note: Run checks in parallel
2785
+ await Promise.all(this.llmExecutionTools.map((tools) => tools.checkConfiguration()));
2788
2786
  }
2789
2787
  /**
2790
2788
  * List all available models that can be used
2791
2789
  * This lists is a combination of all available models from all execution tools
2792
2790
  */
2793
2791
  async listModels() {
2794
- const availableModels = [];
2795
- for (const llmExecutionTools of this.llmExecutionTools) {
2796
- // TODO: [🪂] Obtain models in parallel
2797
- const models = await llmExecutionTools.listModels();
2798
- availableModels.push(...models);
2799
- }
2800
- return availableModels;
2792
+ // Obtain all models in parallel and flatten
2793
+ const modelArrays = await Promise.all(this.llmExecutionTools.map((tools) => tools.listModels()));
2794
+ return modelArrays.flat();
2801
2795
  }
2802
2796
  /**
2803
2797
  * Calls the best available chat model