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 thetaskTypeisTaskType.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 aMinimalServiceSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic MinimalServiceSettingsstatic MinimalServiceSettingsReturns the value of thedimensionsrecord component.Returns the value of theelementTyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static MinimalServiceSettingsparse(XContentParser parser) static MinimalServiceSettingsrerank()Returns the value of thesimilarityrecord component.static MinimalServiceSettingstaskType()Returns the value of thetaskTyperecord component.static MinimalServiceSettingstextEmbedding(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, waitMethods 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 aMinimalServiceSettingsrecord class.- Parameters:
taskType- the value for thetaskTyperecord componentdimensions- the value for thedimensionsrecord componentsimilarity- the value for thesimilarityrecord componentelementType- the value for theelementTyperecord 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:
toXContentin 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 thetaskTyperecord component.- Returns:
- the value of the
taskTyperecord component
-
dimensions
Returns the value of thedimensionsrecord component.- Returns:
- the value of the
dimensionsrecord component
-
similarity
Returns the value of thesimilarityrecord component.- Returns:
- the value of the
similarityrecord component
-
elementType
Returns the value of theelementTyperecord component.- Returns:
- the value of the
elementTyperecord component
-