Class RerankRequest

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.inference.RerankRequest
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class RerankRequest extends RequestBase implements JsonpSerializable
Perform reranking inference on the service.
See Also:
  • Field Details

  • Method Details

    • of

    • inferenceId

      public final String inferenceId()
      Required - The unique identifier for the inference endpoint.

      API name: inference_id

    • input

      public final RerankInput input()
      Required - The documents to rank. The input can be specified as a single string or an array of strings, or as an object or an array of objects. The object form additionally allows specifying non-text inputs, such as images.

      info Only the elastic service currently supports non-text inputs for the rerank task. For all other services, the input must be a string or an array of strings.

      string example:

       "input": "some document text"
       
       

      string array example:

       "input": ["some document text", "some more document text"]
       
       

      object example:

       "input": {
         "type": "image",
         "format": "base64",
         "value": "data:image/jpeg;base64,..."
       }
       
       

      object array example:

       "input": [
         {
           "type": "text",
           "format": "text",
           "value": "some document text"
         },
         {
           "type": "image",
           "format": "base64",
           "value": "data:image/jpeg;base64,..."
         }
       ]
       
       

      API name: input

    • query

      public final RerankQuery query()
      Required - Query input. The query can be specified as a single string, or as an object. The object form additionally allows specifying non-text inputs, such as images.

      info Only the elastic service currently supports non-text queries for the rerank task. For all other services, the query must be a string.

      string example:

       "query": "some query text"
       
       

      object example:

       "query": {
         "type": "image",
         "format": "base64",
         "value": "data:image/jpeg;base64,..."
       }
       
       

      API name: query

    • returnDocuments

      @Nullable public final Boolean returnDocuments()
      Include the document text in the response.

      API name: return_documents

    • taskSettings

      @Nullable public final JsonData taskSettings()
      Task settings for the individual inference request. These settings are specific to the task type you specified and override the task settings specified when initializing the service.

      API name: task_settings

    • timeout

      @Nullable public final Time timeout()
      The amount of time to wait for the inference request to complete.

      API name: timeout

    • topN

      @Nullable public final Integer topN()
      Limit the response to the top N documents.

      API name: top_n

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • rebuild

      public RerankRequest.Builder rebuild()
      Returns:
      New RerankRequest.Builder initialized with field values of this instance
    • setupRerankRequestDeserializer

      protected static void setupRerankRequestDeserializer(ObjectDeserializer<RerankRequest.Builder> op)