Package dev.case.api.models.llm.v1
Class V1CreateEmbeddingParams.Input
-
- All Implemented Interfaces:
public final class V1CreateEmbeddingParams.InputText or array of texts to create embeddings for
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceV1CreateEmbeddingParams.Input.VisitorAn interface that defines how to map each variant of Input to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<String>string()final Optional<List<String>>strings()final BooleanisString()final BooleanisStrings()final StringasString()final List<String>asStrings()final Optional<JsonValue>_json()final <T extends Any> Taccept(V1CreateEmbeddingParams.Input.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final V1CreateEmbeddingParams.Inputvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static V1CreateEmbeddingParams.InputofString(String string)final static V1CreateEmbeddingParams.InputofStrings(List<String> strings)-
-
Method Detail
-
accept
final <T extends Any> T accept(V1CreateEmbeddingParams.Input.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 dev.case.api.core.JsonValue; import java.util.Optional; Optional<String> result = input.accept(new Input.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 V1CreateEmbeddingParams.Input 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 V1CreateEmbeddingParams.Input ofString(String string)
-
ofStrings
final static V1CreateEmbeddingParams.Input ofStrings(List<String> strings)
-
-
-
-