Module org.elasticsearch.server
Package org.elasticsearch.inference
Record Class MinimalServiceSettings
java.lang.Object
java.lang.Record
org.elasticsearch.inference.MinimalServiceSettings
- Record Components:
taskType
- the type of task the inference model performs.dimensions
- the number of dimensions for the embeddings, applicable only forTaskType.TEXT_EMBEDDING
(nullable).similarity
- the similarity measure used for embeddings, applicable only forTaskType.TEXT_EMBEDDING
(nullable).elementType
- the type of elements in the embeddings, applicable only forTaskType.TEXT_EMBEDDING
(nullable).
- All Implemented Interfaces:
ToXContent
,ToXContentObject
public record MinimalServiceSettings(TaskType taskType, Integer dimensions, SimilarityMeasure similarity, DenseVectorFieldMapper.ElementType elementType)
extends Record
implements ToXContentObject
Defines the base settings required to configure an inference endpoint.
These settings are immutable and describe the input and output types that the endpoint will handle.
They capture the essential properties of an inference model, ensuring the endpoint is correctly configured.
Key properties include:
taskType
- Specifies the type of task the model performs, such as classification or text embeddings.dimensions
,similarity
, andelementType
- These settings are applicable only when thetaskType
isTaskType.TEXT_EMBEDDING
. They define the structure and behavior of embeddings.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Field Summary
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionMinimalServiceSettings
(Model model) MinimalServiceSettings
(TaskType taskType, Integer dimensions, SimilarityMeasure similarity, DenseVectorFieldMapper.ElementType elementType) Creates an instance of aMinimalServiceSettings
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic MinimalServiceSettings
static MinimalServiceSettings
Returns the value of thedimensions
record component.Returns the value of theelementType
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static MinimalServiceSettings
parse
(XContentParser parser) static MinimalServiceSettings
rerank()
Returns the value of thesimilarity
record component.static MinimalServiceSettings
taskType()
Returns the value of thetaskType
record component.static MinimalServiceSettings
textEmbedding
(int dimensions, SimilarityMeasure similarity, DenseVectorFieldMapper.ElementType elementType) toString()
Returns a string representation of this record class.toXContent
(XContentBuilder builder, ToXContent.Params params) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
TASK_TYPE_FIELD
- See Also:
-
-
Constructor Details
-
MinimalServiceSettings
-
MinimalServiceSettings
public MinimalServiceSettings(TaskType taskType, @Nullable Integer dimensions, @Nullable SimilarityMeasure similarity, @Nullable DenseVectorFieldMapper.ElementType elementType) Creates an instance of aMinimalServiceSettings
record class.- Parameters:
taskType
- the value for thetaskType
record componentdimensions
- the value for thedimensions
record componentsimilarity
- the value for thesimilarity
record componentelementType
- the value for theelementType
record component
-
-
Method Details
-
parse
- Throws:
IOException
-
textEmbedding
public static MinimalServiceSettings textEmbedding(int dimensions, SimilarityMeasure similarity, DenseVectorFieldMapper.ElementType elementType) -
sparseEmbedding
-
rerank
-
completion
-
chatCompletion
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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)
. -
taskType
Returns the value of thetaskType
record component.- Returns:
- the value of the
taskType
record component
-
dimensions
Returns the value of thedimensions
record component.- Returns:
- the value of the
dimensions
record component
-
similarity
Returns the value of thesimilarity
record component.- Returns:
- the value of the
similarity
record component
-
elementType
Returns the value of theelementType
record component.- Returns:
- the value of the
elementType
record component
-