Meshpocalypse Semantic
    Preparing search index...

    Function getBudgetUtilisation

    • Compute budget utilisation ratio for a given budget.

      Queries Oxigraph for the budget identified by budgetId and returns the ratio of spentTokens / maxTokens.

      • Returns 0.0 if no budget is found for the given id.
      • Returns 1.0 if maxTokens is 0 (fully consumed / degenerate).

      Parameters

      • budgetId: string

        The budget identifier key (must pass SAFE_IRI_KEY_RE)

      • config: AiGatewayConfig

        Gateway configuration

      Returns Promise<number>

      Utilisation ratio clamped to [0.0, 1.0]

      If budgetId is unsafe