Class SessionActParams.Options.Model
-
- All Implemented Interfaces:
public final class SessionActParams.Options.ModelModel configuration object or model name string (e.g., 'openai/gpt-5-nano')
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceSessionActParams.Options.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<ModelConfig>config()final Optional<String>string()final BooleanisConfig()final BooleanisString()final ModelConfigasConfig()final StringasString()final Optional<JsonValue>_json()final <T extends Any> Taccept(SessionActParams.Options.Model.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final SessionActParams.Options.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 SessionActParams.Options.ModelofConfig(ModelConfig config)final static SessionActParams.Options.ModelofString(String string)-
-
Method Detail
-
config
final Optional<ModelConfig> config()
-
asConfig
final ModelConfig asConfig()
-
accept
final <T extends Any> T accept(SessionActParams.Options.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.browserbase.api.core.JsonValue; import java.util.Optional; Optional<String> result = model.accept(new Model.Visitor<Optional<String>>() { @Override public Optional<String> visitConfig(ModelConfig config) { return Optional.of(config.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final SessionActParams.Options.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.
-
ofConfig
final static SessionActParams.Options.Model ofConfig(ModelConfig config)
-
ofString
final static SessionActParams.Options.Model ofString(String string)
-
-
-
-