Class Run.Usage
-
- All Implemented Interfaces:
public final class Run.Usage
Usage statistics related to the run. This value will be
null
if the run is not in a terminal state (i.e.in_progress
,queued
, etc.).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
Run.Usage.Builder
A builder for Usage.
-
Method Summary
Modifier and Type Method Description final Long
completionTokens()
Number of completion tokens used over the course of the run. final Long
promptTokens()
Number of prompt tokens used over the course of the run. final Long
totalTokens()
Total number of tokens used (prompt + completion). final JsonField<Long>
_completionTokens()
Returns the raw JSON value of completionTokens. final JsonField<Long>
_promptTokens()
Returns the raw JSON value of promptTokens. final JsonField<Long>
_totalTokens()
Returns the raw JSON value of totalTokens. final Map<String, JsonValue>
_additionalProperties()
final Run.Usage.Builder
toBuilder()
final Run.Usage
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Run.Usage.Builder
builder()
Returns a mutable builder for constructing an instance of Usage. -
-
Method Detail
-
completionTokens
final Long completionTokens()
Number of completion tokens used over the course of the run.
-
promptTokens
final Long promptTokens()
Number of prompt tokens used over the course of the run.
-
totalTokens
final Long totalTokens()
Total number of tokens used (prompt + completion).
-
_completionTokens
final JsonField<Long> _completionTokens()
Returns the raw JSON value of completionTokens.
Unlike completionTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_promptTokens
final JsonField<Long> _promptTokens()
Returns the raw JSON value of promptTokens.
Unlike promptTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_totalTokens
final JsonField<Long> _totalTokens()
Returns the raw JSON value of totalTokens.
Unlike totalTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Run.Usage.Builder toBuilder()
-
builder
final static Run.Usage.Builder builder()
Returns a mutable builder for constructing an instance of Usage.
The following fields are required:
.completionTokens() .promptTokens() .totalTokens()
-
-
-
-