Module org.elasticsearch.xcore
Class InferModelAction.Request
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.AbstractTransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.LegacyActionRequest
org.elasticsearch.xpack.core.ml.action.InferModelAction.Request
- All Implemented Interfaces:
Writeable,org.elasticsearch.core.RefCounted,TaskAwareRequest,TransportRequest
- Enclosing class:
InferModelAction
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.core.TimeValuestatic final org.elasticsearch.core.TimeValuestatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic InferModelAction.RequestforIngestDocs(String id, List<Map<String, Object>> docs, InferenceConfigUpdate update, boolean previouslyLicensed, org.elasticsearch.core.TimeValue inferenceTimeout) Build a request from a list of documents as maps.static InferModelAction.RequestforTextInput(String id, InferenceConfigUpdate update, List<String> textInput, boolean previouslyLicensed, org.elasticsearch.core.TimeValue inferenceTimeout) Build a request from a list of strings, each string is one evaluation of the model.getId()org.elasticsearch.core.TimeValueinthashCode()booleanbooleanbooleanintparseRequest(String id, org.elasticsearch.xcontent.XContentParser parser) voidsetChunked(boolean chunked) voidsetHighPriority(boolean highPriority) voidsetPrefixType(TrainedModelPrefixStrings.PrefixType prefixType) validate()voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResultMethods inherited from class org.elasticsearch.transport.AbstractTransportRequest
getParentTask, getRequestId, remoteAddress, remoteAddress, setParentTask, setRequestId, toStringMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, tryIncRefMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
Field Details
-
ID
public static final org.elasticsearch.xcontent.ParseField ID -
DEPLOYMENT_ID
public static final org.elasticsearch.xcontent.ParseField DEPLOYMENT_ID -
DOCS
public static final org.elasticsearch.xcontent.ParseField DOCS -
TIMEOUT
public static final org.elasticsearch.xcontent.ParseField TIMEOUT -
INFERENCE_CONFIG
public static final org.elasticsearch.xcontent.ParseField INFERENCE_CONFIG -
DEFAULT_TIMEOUT_FOR_API
public static final org.elasticsearch.core.TimeValue DEFAULT_TIMEOUT_FOR_API -
DEFAULT_TIMEOUT_FOR_INGEST
public static final org.elasticsearch.core.TimeValue DEFAULT_TIMEOUT_FOR_INGEST
-
-
Constructor Details
-
Request
- Throws:
IOException
-
-
Method Details
-
parseRequest
public static InferModelAction.Request.Builder parseRequest(String id, org.elasticsearch.xcontent.XContentParser parser) -
forIngestDocs
public static InferModelAction.Request forIngestDocs(String id, List<Map<String, Object>> docs, InferenceConfigUpdate update, boolean previouslyLicensed, org.elasticsearch.core.TimeValue inferenceTimeout) Build a request from a list of documents as maps.- Parameters:
id- The model Iddocs- List of document mapsupdate- Inference config updatepreviouslyLicensed- License has been checked previously and can now be skippedinferenceTimeout- The inference timeout (how long the request waits in the inference queue for)- Returns:
- the new Request
-
forTextInput
public static InferModelAction.Request forTextInput(String id, InferenceConfigUpdate update, List<String> textInput, boolean previouslyLicensed, org.elasticsearch.core.TimeValue inferenceTimeout) Build a request from a list of strings, each string is one evaluation of the model.- Parameters:
id- The model Idupdate- Inference config updatetextInput- Inference inputpreviouslyLicensed- License has been checked previously and can now be skippedinferenceTimeout- The inference timeout (how long the request waits in the inference queue for)- Returns:
- the new Request
-
numberOfDocuments
public int numberOfDocuments() -
getId
-
getObjectsToInfer
-
getTextInput
-
getUpdate
-
isPreviouslyLicensed
public boolean isPreviouslyLicensed() -
getInferenceTimeout
public org.elasticsearch.core.TimeValue getInferenceTimeout() -
isHighPriority
public boolean isHighPriority() -
setHighPriority
public void setHighPriority(boolean highPriority) -
setPrefixType
-
getPrefixType
-
setChunked
public void setChunked(boolean chunked) -
isChunked
public boolean isChunked() -
validate
- Specified by:
validatein classActionRequest
-
writeTo
- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classActionRequest- Throws:
IOException
-
equals
-
createTask
-
hashCode
public int hashCode()
-