Search Results for

    Show / Hide Table of Contents

    Class UsageCalculator

    Handles all cost calculation logic for Usage and UsageInfo.

    Inheritance
    object
    UsageCalculator
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    public static class UsageCalculator

    Methods

    | Edit this page View Source

    CalcCostInUsd(UsageInfo, string)

    Calculates and writes costInUsd for the given model.

    Declaration
    public static void CalcCostInUsd(this UsageInfo usageInfo, string modelId)
    Parameters
    Type Name Description
    UsageInfo usageInfo
    string modelId
    | Edit this page View Source

    CalcCostsOnRequestComplete(Usage, string)

    Calculates the USD cost for every UsageInfo item in the usage object. Must be called after receiving usage data from the API.

    Declaration
    public static void CalcCostsOnRequestComplete(this Usage u, string modelId)
    Parameters
    Type Name Description
    Usage u
    string modelId
    | Edit this page View Source

    GetTotalCostInUsd(Usage)

    Returns the sum of all per-item USD costs stored in the usage object.

    Declaration
    public static double GetTotalCostInUsd(this Usage u)
    Parameters
    Type Name Description
    Usage u
    Returns
    Type Description
    double
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation