Module org.elasticsearch.xcore
Class InferenceAction.Request
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.AbstractTransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.UntypedActionRequest
org.elasticsearch.xpack.core.inference.action.BaseInferenceActionRequest
org.elasticsearch.xpack.core.inference.action.InferenceAction.Request
- All Implemented Interfaces:
Writeable,RefCounted,TaskAwareRequest,TransportRequest
- Enclosing class:
InferenceAction
-
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 ParseFieldstatic final ParseFieldA set of theTaskTypevalues which can useInferenceAction.static final ParseFieldstatic final ParseFieldFields inherited from class org.elasticsearch.xpack.core.inference.action.BaseInferenceActionRequest
INFERENCE_REQUEST_PER_TASK_TIMEOUT_ADDED, OLD_DEFAULT_TIMEOUT, TIMEOUT_NOT_DETERMINEDFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
ConstructorsConstructorDescriptionRequest(StreamInput in) Request(TaskType taskType, String inferenceEntityId, List<String> input, Map<String, Object> taskSettings, InputType inputType, TimeValue inferenceTimeout, boolean stream) Constructor that uses an emptyInferenceContextRequest(TaskType taskType, String inferenceEntityId, List<String> input, Map<String, Object> taskSettings, InputType inputType, TimeValue inferenceTimeout, boolean stream, InferenceContext context) Constructor that allows anInferenceContextto be specified -
Method Summary
Modifier and TypeMethodDescriptionbooleangetInput()inthashCode()booleanparseRequest(String inferenceEntityId, TaskType taskType, InferenceContext context, XContentParser parser) toString()validate()voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.core.inference.action.BaseInferenceActionRequest
getContext, getDefaultTimeoutForTaskType, resolveTimeoutForTaskTypeMethods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResultMethods inherited from class org.elasticsearch.transport.AbstractTransportRequest
copyFieldsFrom, getParentTask, getRequestId, remoteAddress, remoteAddress, setParentTask, setRequestIdMethods 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, createTask, getDescription, setParentTask
-
Field Details
-
INPUT
-
INPUT_TYPE
-
TASK_SETTINGS
-
TIMEOUT
-
SUPPORTED_INFERENCE_ACTION_TASK_TYPES
A set of theTaskTypevalues which can useInferenceAction. ForTaskTypenot included here, please useUnifiedCompletionAction,EmbeddingActionorRerankActionas appropriate
-
-
Constructor Details
-
Request
public Request(TaskType taskType, String inferenceEntityId, List<String> input, Map<String, Object> taskSettings, InputType inputType, @Nullable TimeValue inferenceTimeout, boolean stream) Constructor that uses an emptyInferenceContext- Parameters:
taskType- theTaskTypeof the inference request. May beTaskType.ANY, which will result in the task type being determined after parsing the stored modelinferenceEntityId- the endpoint IDinput- the inputs to use for the inference requesttaskSettings- the task settings to use for the inference requestinputType- theInputTypeof the requestinferenceTimeout- the timeout to use. If null, a placeholder timeout will be used until the appropriate timeout for the task type and input type can be determined by the inference service implementationstream- whether the request should use streaming
-
Request
public Request(TaskType taskType, String inferenceEntityId, List<String> input, Map<String, Object> taskSettings, InputType inputType, @Nullable TimeValue inferenceTimeout, boolean stream, InferenceContext context) Constructor that allows anInferenceContextto be specified- Parameters:
taskType- theTaskTypeof the inference request. May beTaskType.ANY, which will result in the task type being determined after parsing the stored modelinferenceEntityId- the endpoint IDinput- the inputs to use for the inference requesttaskSettings- the task settings to use for the inference requestinputType- theInputTypeof the requestinferenceTimeout- the timeout to use. If null, a placeholder timeout will be used until the appropriate timeout for the task type and input type can be determined by the inference service implementationstream- whether the request should use streamingcontext- theInferenceContextto use, ifnullthen an empty context will be used
-
Request
- Throws:
IOException
-
-
Method Details
-
builder
-
parseRequest
public static InferenceAction.Request.Builder parseRequest(String inferenceEntityId, TaskType taskType, InferenceContext context, XContentParser parser) throws IOException - Throws:
IOException
-
getTaskType
- Specified by:
getTaskTypein classBaseInferenceActionRequest
-
getInferenceEntityId
- Specified by:
getInferenceEntityIdin classBaseInferenceActionRequest
-
getInput
-
getTaskSettings
-
getInputType
-
getInferenceTimeout
-
isStreaming
public boolean isStreaming()- Specified by:
isStreamingin classBaseInferenceActionRequest
-
validate
- Specified by:
validatein classActionRequest
-
writeTo
- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classBaseInferenceActionRequest- Throws:
IOException
-
equals
- Overrides:
equalsin classBaseInferenceActionRequest
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseInferenceActionRequest
-
toString
- Overrides:
toStringin classAbstractTransportRequest
-