Class RealtimeResponseCreateParams.MaxOutputTokens
-
- All Implemented Interfaces:
public final class RealtimeResponseCreateParams.MaxOutputTokensMaximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
inffor the maximum available tokens for a given model. Defaults toinf.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRealtimeResponseCreateParams.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(RealtimeResponseCreateParams.MaxOutputTokens.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final RealtimeResponseCreateParams.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 RealtimeResponseCreateParams.MaxOutputTokensofInteger(Long integer)final static RealtimeResponseCreateParams.MaxOutputTokensofInf()-
-
Method Detail
-
accept
final <T extends Any> T accept(RealtimeResponseCreateParams.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 RealtimeResponseCreateParams.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 RealtimeResponseCreateParams.MaxOutputTokens ofInteger(Long integer)
-
ofInf
final static RealtimeResponseCreateParams.MaxOutputTokens ofInf()
-
-
-
-