Class DefaultEmbeddingRequestParameters
java.lang.Object
dev.langchain4j.model.embedding.request.DefaultEmbeddingRequestParameters
- All Implemented Interfaces:
EmbeddingRequestParameters
- Direct Known Subclasses:
OpenAiEmbeddingRequestParameters
@Experimental
public class DefaultEmbeddingRequestParameters
extends Object
implements EmbeddingRequestParameters
The default, map-backed implementation of
EmbeddingRequestParameters.
All values are stored in a single Map<EmbeddingParameter<?>, Object>, keyed by their
EmbeddingParameter token. As a result presentParameters() is simply the map's key set and
can never drift from the typed getters: introducing a new parameter automatically makes it part of the
populated set, so an implementation that has not opted into it will reject requests that use it.
Only non-null values are stored, so a parameter is "present" exactly when it has been explicitly set.
Provider integrations extend this class (and its DefaultEmbeddingRequestParameters.Builder) to add provider-specific parameters,
reusing the same map so the opt-in mechanism keeps working for them too.
- Since:
- 1.18.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
Fields inherited from interface EmbeddingRequestParameters
DIMENSIONS, EMPTY, INPUT_TYPE, MODEL_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionbuilder()booleaninthashCode()Creates a newEmbeddingRequestParametersby combining the current parameters with the specified ones.<T> Tparameter(EmbeddingParameter<T> parameter) Returns the value of the given parameter, ornullif it is not populated.Returns the set of parameters that are actually populated (non-null) in this instance.toString()
-
Constructor Details
-
DefaultEmbeddingRequestParameters
-
-
Method Details
-
modelName
- Specified by:
modelNamein interfaceEmbeddingRequestParameters
-
dimensions
- Specified by:
dimensionsin interfaceEmbeddingRequestParameters
-
inputType
- Specified by:
inputTypein interfaceEmbeddingRequestParameters
-
parameter
Description copied from interface:EmbeddingRequestParametersReturns the value of the given parameter, ornullif it is not populated.- Specified by:
parameterin interfaceEmbeddingRequestParameters- Type Parameters:
T- the value type.- Parameters:
parameter- the parameter token.- Returns:
- the value, or
null.
-
presentParameters
Description copied from interface:EmbeddingRequestParametersReturns the set of parameters that are actually populated (non-null) in this instance. This is what anEmbeddingModelvalidates against itsEmbeddingModel.supportedParameters().- Specified by:
presentParametersin interfaceEmbeddingRequestParameters- Returns:
- the populated parameters; never
null.
-
overrideWith
Description copied from interface:EmbeddingRequestParametersCreates a newEmbeddingRequestParametersby combining the current parameters with the specified ones. Values from the specified parameters override values from the current parameters when there is overlap. Neither instance is modified.- Specified by:
overrideWithin interfaceEmbeddingRequestParameters- Parameters:
that- the parameters whose values will override the current ones.- Returns:
- a new combined
EmbeddingRequestParametersinstance.
-
equals
-
hashCode
-
toString
-
builder
-