Module org.elasticsearch.server
Record Class EndpointMetadata
java.lang.Object
java.lang.Record
org.elasticsearch.inference.metadata.EndpointMetadata
- Record Components:
heuristics- contains information so clients of the Inference API can determine which models should be used as defaults and presented to users in different scenarios.internal- contains information that is only used within Elasticsearch. The internal information helps the Inference API know when it needs to update the preconfigured endpoints by tracking the upstream fingerprint and an internal version.display- contains information for how to display the endpoint in user interfaces (descriptive name, etc).
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
public record EndpointMetadata(EndpointMetadata.Heuristics heuristics, EndpointMetadata.Internal internal, EndpointMetadata.Display display)
extends Record
implements ToXContentObject, Writeable
Endpoint metadata contains descriptive information for an inference endpoint. This information allows an upstream service to communicate
the features a particular model supports and other properties to help clients of the Inference API determine which model to use for
defaults in different scenarios.
The Elastic Inference Service populates these fields so that Kibana and semantic text fields determine the correct defaults.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordHeuristics about the model used in the endpoint to help clients of the Inference API determine which models to use.static final recordInternal metadata used by Elasticsearch.Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final EndpointMetadatastatic final Stringstatic final TransportVersionstatic final Stringstatic final StringFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionEndpointMetadata(EndpointMetadata.Heuristics heuristics, EndpointMetadata.Internal internal, EndpointMetadata.Display display) Creates an instance of aEndpointMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptiondisplay()Returns the value of thedisplayrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanfinal inthashCode()Returns a hash code value for this object.booleanReturns the value of theheuristicsrecord component.internal()Returns the value of theinternalrecord component.booleanisEmpty()static EndpointMetadataparse(XContentParser parser) final StringtoString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.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
-
INFERENCE_ENDPOINT_METADATA_FIELDS_ADDED
-
EMPTY_INSTANCE
-
METADATA_FIELD_NAME
- See Also:
-
HEURISTICS_FIELD_NAME
- See Also:
-
INTERNAL_FIELD_NAME
- See Also:
-
DISPLAY_FIELD_NAME
- See Also:
-
-
Constructor Details
-
EndpointMetadata
public EndpointMetadata(EndpointMetadata.Heuristics heuristics, EndpointMetadata.Internal internal, EndpointMetadata.Display display) Creates an instance of aEndpointMetadatarecord class.- Parameters:
heuristics- the value for theheuristicsrecord componentinternal- the value for theinternalrecord componentdisplay- the value for thedisplayrecord component
-
EndpointMetadata
- Throws:
IOException
-
-
Method Details
-
parse
- Throws:
IOException
-
isEmpty
public boolean isEmpty() -
fingerprintMatches
-
hasNewerVersionThan
-
getXContentParamsExcludeInternalFields
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- 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). -
heuristics
Returns the value of theheuristicsrecord component.- Returns:
- the value of the
heuristicsrecord component
-
internal
Returns the value of theinternalrecord component.- Returns:
- the value of the
internalrecord component
-
display
Returns the value of thedisplayrecord component.- Returns:
- the value of the
displayrecord component
-