Type alias TokenEstimator

TokenEstimator: ((content, modelId?) => Promise<number>)

Function signature for estimating token counts. This is passed to templates to allow them to make token-aware decisions.

Type declaration

    • (content, modelId?): Promise<number>
    • Parameters

      • content: string
      • Optional modelId: string

      Returns Promise<number>