Package com.openai.models.realtime
Class RealtimeResponse.MaxOutputTokens
-
- All Implemented Interfaces:
public final class RealtimeResponse.MaxOutputTokensMaximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRealtimeResponse.MaxOutputTokens.VisitorAn interface that defines how to map each variant of MaxOutputTokens to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<Long>integer()final Optional<JsonValue>inf()final BooleanisInteger()final BooleanisInf()final LongasInteger()final JsonValueasInf()final Optional<JsonValue>_json()final <T extends Any> Taccept(RealtimeResponse.MaxOutputTokens.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final RealtimeResponse.MaxOutputTokensvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RealtimeResponse.MaxOutputTokensofInteger(Long integer)final static RealtimeResponse.MaxOutputTokensofInf()-
-
Method Detail
-
accept
final <T extends Any> T accept(RealtimeResponse.MaxOutputTokens.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 = maxOutputTokens.accept(new MaxOutputTokens.Visitor<Optional<String>>() { @Override public Optional<String> visitInteger(Long integer) { return Optional.of(integer.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final RealtimeResponse.MaxOutputTokens 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.
-
ofInteger
final static RealtimeResponse.MaxOutputTokens ofInteger(Long integer)
-
ofInf
final static RealtimeResponse.MaxOutputTokens ofInf()
-
-
-
-