Class Usage
- Namespace
- Uralstech.UAI.Abstraction
Represents the token usage of an inference request.
public record Usage
- Inheritance
-
objectUsage
Constructors
Usage(string, int, int)
public Usage(string modelProvider, int inputTokens, int outputTokens)
Parameters
modelProvider
stringThe model provider that the usage is associated with.
inputTokens
intThe number of input tokens used in the inference request.
outputTokens
intThe number of output tokens the inference request generated.
Fields
Empty
Empty value.
public static readonly Usage Empty
Field Value
InputTokens
The number of input tokens used in the inference request.
public readonly int InputTokens
Field Value
- int
ModelProvider
The model provider that the usage is associated with.
public readonly string ModelProvider
Field Value
- string
OutputTokens
The number of output tokens the inference request generated.
public readonly int OutputTokens
Field Value
- int
Methods
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator +(Usage, Usage)
Adds two usage objects together.
public static Usage operator +(Usage a, Usage b)
Parameters
Returns
Exceptions
- InvalidOperationException
Thrown if the model providers of the objects are different and neither are Empty.