Class DpoHyperparameters.Beta
-
- All Implemented Interfaces:
public final class DpoHyperparameters.BetaThe beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceDpoHyperparameters.Beta.VisitorAn interface that defines how to map each variant of Beta to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<JsonValue>auto()final Optional<Double>number()final BooleanisAuto()final BooleanisNumber()final JsonValueasAuto()final DoubleasNumber()final Optional<JsonValue>_json()final <T extends Any> Taccept(DpoHyperparameters.Beta.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final DpoHyperparameters.Betavalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static DpoHyperparameters.BetaofAuto()final static DpoHyperparameters.BetaofNumber(Double number)-
-
Method Detail
-
accept
final <T extends Any> T accept(DpoHyperparameters.Beta.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 = beta.accept(new Beta.Visitor<Optional<String>>() { @Override public Optional<String> visitAuto(JsonValue auto) { return Optional.of(auto.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final DpoHyperparameters.Beta 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.
-
ofAuto
final static DpoHyperparameters.Beta ofAuto()
-
ofNumber
final static DpoHyperparameters.Beta ofNumber(Double number)
-
-
-
-