Record Class EmbeddingParameter<T>
java.lang.Object
java.lang.Record
dev.langchain4j.model.embedding.request.EmbeddingParameter<T>
- Type Parameters:
T- the type of the value this parameter holds.- Record Components:
name- a globally unique, human-readable name for this parameter (e.g."dimensions").type- the type of the value this parameter holds.
A typed, stable identifier for a single
EmbeddingRequestParameters value.
Parameters are identified by tokens (rather than plain strings) so that:
- the value type is known at compile time (see
type()); - provider modules can declare their own parameters (e.g. an OpenAI
USERtoken) without touchinglangchain4j-core; - an
EmbeddingModelcan declare exactly which parameters it honors viaEmbeddingModel.supportedParameters(). Any parameter present in a request but absent from that set is rejected, so a newly introduced parameter is opt-in: an implementation that has not explicitly declared support for it will fail fast instead of silently ignoring it.
name() is equal; the name is therefore the
globally unique identity of a parameter and must not collide across providers. equals(Object) and
hashCode() intentionally key on name only, ignoring type().- Since:
- 1.18.0
-
Constructor Summary
ConstructorsConstructorDescriptionEmbeddingParameter(String name, Class<T> type) Creates an instance of aEmbeddingParameterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionCasts the given value to this parameter'stype().booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
EmbeddingParameter
-
-
Method Details
-
cast
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
hashCode
-
toString
-
name
-
type
-