Class InferModelAction.Request

All Implemented Interfaces:
Writeable, org.elasticsearch.core.RefCounted, TaskAwareRequest, TransportRequest
Enclosing class:
InferModelAction

public static class InferModelAction.Request extends LegacyActionRequest
  • 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

  • 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 Id
      docs - List of document maps
      update - Inference config update
      previouslyLicensed - License has been checked previously and can now be skipped
      inferenceTimeout - 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 Id
      update - Inference config update
      textInput - Inference input
      previouslyLicensed - License has been checked previously and can now be skipped
      inferenceTimeout - The inference timeout (how long the request waits in the inference queue for)
      Returns:
      the new Request
    • numberOfDocuments

      public int numberOfDocuments()
    • getId

      public String getId()
    • getObjectsToInfer

      public List<Map<String,Object>> getObjectsToInfer()
    • getTextInput

      public List<String> getTextInput()
    • getUpdate

      public InferenceConfigUpdate getUpdate()
    • isPreviouslyLicensed

      public boolean isPreviouslyLicensed()
    • getInferenceTimeout

      public org.elasticsearch.core.TimeValue getInferenceTimeout()
    • isHighPriority

      public boolean isHighPriority()
    • setHighPriority

      public void setHighPriority(boolean highPriority)
    • setPrefixType

      public void setPrefixType(TrainedModelPrefixStrings.PrefixType prefixType)
    • getPrefixType

      public TrainedModelPrefixStrings.PrefixType getPrefixType()
    • setChunked

      public void setChunked(boolean chunked)
    • isChunked

      public boolean isChunked()
    • validate

      Specified by:
      validate in class ActionRequest
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class ActionRequest
      Throws:
      IOException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • createTask

      public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String,String> headers)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object