Class TranscriptionDiarized.Usage
-
- All Implemented Interfaces:
public final class TranscriptionDiarized.UsageToken or duration usage statistics for the request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceTranscriptionDiarized.Usage.VisitorAn interface that defines how to map each variant of Usage to a value of type T.
public final classTranscriptionDiarized.Usage.TokensUsage statistics for models billed by token usage.
public final classTranscriptionDiarized.Usage.DurationUsage statistics for models billed by audio input duration.
-
Method Summary
Modifier and Type Method Description final Optional<TranscriptionDiarized.Usage.Tokens>tokens()Usage statistics for models billed by token usage. final Optional<TranscriptionDiarized.Usage.Duration>duration()Usage statistics for models billed by audio input duration. final BooleanisTokens()final BooleanisDuration()final TranscriptionDiarized.Usage.TokensasTokens()Usage statistics for models billed by token usage. final TranscriptionDiarized.Usage.DurationasDuration()Usage statistics for models billed by audio input duration. final Optional<JsonValue>_json()final <T extends Any> Taccept(TranscriptionDiarized.Usage.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final TranscriptionDiarized.Usagevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static TranscriptionDiarized.UsageofTokens(TranscriptionDiarized.Usage.Tokens tokens)Usage statistics for models billed by token usage. final static TranscriptionDiarized.UsageofDuration(TranscriptionDiarized.Usage.Duration duration)Usage statistics for models billed by audio input duration. -
-
Method Detail
-
tokens
final Optional<TranscriptionDiarized.Usage.Tokens> tokens()
Usage statistics for models billed by token usage.
-
duration
final Optional<TranscriptionDiarized.Usage.Duration> duration()
Usage statistics for models billed by audio input duration.
-
isDuration
final Boolean isDuration()
-
asTokens
final TranscriptionDiarized.Usage.Tokens asTokens()
Usage statistics for models billed by token usage.
-
asDuration
final TranscriptionDiarized.Usage.Duration asDuration()
Usage statistics for models billed by audio input duration.
-
accept
final <T extends Any> T accept(TranscriptionDiarized.Usage.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = usage.accept(new Usage.Visitor<Optional<String>>() { @Override public Optional<String> visitTokens(Tokens tokens) { return Optional.of(tokens.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final TranscriptionDiarized.Usage validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofTokens
final static TranscriptionDiarized.Usage ofTokens(TranscriptionDiarized.Usage.Tokens tokens)
Usage statistics for models billed by token usage.
-
ofDuration
final static TranscriptionDiarized.Usage ofDuration(TranscriptionDiarized.Usage.Duration duration)
Usage statistics for models billed by audio input duration.
-
-
-
-