Table of Contents

Class Usage

Namespace
Glitch9.AIDevKit
[Serializable]
public class Usage : IEquatable<Usage>
Inheritance
object
Usage
Implements
IEquatable<Usage>
Derived

Constructors

Usage()

public Usage()

Usage(UsageType)

public Usage(UsageType type)

Parameters

type UsageType

Fields

costInUsd

public double costInUsd

Field Value

double

m_TypeNameCache

protected string m_TypeNameCache

Field Value

string

type

The type of usage, e.g., Token, Image, Audio, Transcription.

public UsageType type

Field Value

UsageType

Properties

HasValue

public virtual bool HasValue { get; }

Property Value

bool

Methods

CalcCostInUsd(string)

public void CalcCostInUsd(string modelId)

Parameters

modelId string

Equals(Usage)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Usage other)

Parameters

other Usage

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetInspectorTypeName()

public virtual string GetInspectorTypeName()

Returns

string

GetInspectorValueName()

public virtual string GetInspectorValueName()

Returns

string

IsMatchingPrice(ModelPrice)

public bool IsMatchingPrice(ModelPrice price)

Parameters

price ModelPrice

Returns

bool

TryMerge(Usage)

public virtual bool TryMerge(Usage other)

Parameters

other Usage

Returns

bool

Operators

operator ==(Usage, Usage)

public static bool operator ==(Usage left, Usage right)

Parameters

left Usage
right Usage

Returns

bool

operator !=(Usage, Usage)

public static bool operator !=(Usage left, Usage right)

Parameters

left Usage
right Usage

Returns

bool