Class DreamCreateParams.Model
-
- All Implemented Interfaces:
public final class DreamCreateParams.ModelThe model that runs a dream, given as a model ID or as an object with
idandspeed.In the object form,
speedcan only bestandard.The Availability section of the Dreams guide lists the supported models.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceDreamCreateParams.Model.VisitorAn interface that defines how to map each variant of Model to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<String>string()final Optional<BetaDreamModelConfigParam>betaDreamModelConfigParam()The object form of modelin a request to create a dream.final Optional<JsonValue>_json()final BooleanisString()final BooleanisBetaDreamModelConfigParam()final StringasString()final BetaDreamModelConfigParamasBetaDreamModelConfigParam()The object form of modelin a request to create a dream.final <T extends Any> Taccept(DreamCreateParams.Model.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final DreamCreateParams.Modelvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static DreamCreateParams.ModelofString(String string)final static DreamCreateParams.ModelofBetaDreamModelConfigParam(BetaDreamModelConfigParam betaDreamModelConfigParam)The object form of modelin a request to create a dream.final static DreamCreateParams.ModelofBetaDreamModelConfigParam(String id)Returns an immutable instance of Model whose ofBetaDreamModelConfigParam variant is built from the given required id. -
-
Method Detail
-
betaDreamModelConfigParam
final Optional<BetaDreamModelConfigParam> betaDreamModelConfigParam()
The object form of
modelin a request to create a dream.
-
isBetaDreamModelConfigParam
final Boolean isBetaDreamModelConfigParam()
-
asBetaDreamModelConfigParam
final BetaDreamModelConfigParam asBetaDreamModelConfigParam()
The object form of
modelin a request to create a dream.
-
accept
final <T extends Any> T accept(DreamCreateParams.Model.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.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = model.accept(new Model.Visitor<Optional<String>>() { @Override public Optional<String> visitString(String string) { return Optional.of(string.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final DreamCreateParams.Model 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.
-
ofString
final static DreamCreateParams.Model ofString(String string)
-
ofBetaDreamModelConfigParam
final static DreamCreateParams.Model ofBetaDreamModelConfigParam(BetaDreamModelConfigParam betaDreamModelConfigParam)
The object form of
modelin a request to create a dream.
-
ofBetaDreamModelConfigParam
final static DreamCreateParams.Model ofBetaDreamModelConfigParam(String id)
Returns an immutable instance of Model whose ofBetaDreamModelConfigParam variant is built from the given required id.
-
-
-
-