Library API
    Preparing search index...

    Function evaluateConfigAsync

    • Resolves all top-level properties of a configuration object asynchronously. For each property whose value is a function or Promise, executes/awaits the value and sets the property.

      Type Parameters

      • T extends object

      Parameters

      • config: T

        The configuration object to evaluate

      Returns Promise<AsyncEvaluated<T>>

      A Promise resolving to a new object with all properties resolved

      const evaluated = await evaluateConfigAsync({
      key: async () => fetchKey(),
      url: 'https://api.openai.com/v1'
      });
      // { key: 'sk-...', url: 'https://api.openai.com/v1' }