Skip to content

dag-orchestrator / Exports / CelCostEstimatorAdapter

Class: CelCostEstimatorAdapter

Adapter that bridges ICostEstimatorPort with dag-cost's CelCostEvaluator.

For each node in the prompt, looks up cost metadata from storage and evaluates the CEL estimate formula with node inputs as context variables.

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new CelCostEstimatorAdapter(storage): CelCostEstimatorAdapter

Parameters

NameType
storageICostMetaStoragePort

Returns

CelCostEstimatorAdapter

Defined in

adapters/cel-cost-estimator-adapter.ts:15

Methods

estimateCost

estimateCost(prompt, _objectInfo): Promise<TResult<IPromptCostEstimate, IDagError>>

Parameters

NameType
promptTPrompt
_objectInfoTObjectInfo

Returns

Promise<TResult<IPromptCostEstimate, IDagError>>

Implementation of

ICostEstimatorPort.estimateCost

Defined in

adapters/cel-cost-estimator-adapter.ts:17

Released under the MIT License.