Class RerankRequest.Builder

All Implemented Interfaces:
WithJson<RerankRequest.Builder>, ObjectBuilder<RerankRequest>
Enclosing class:
RerankRequest

public static class RerankRequest.Builder extends RequestBase.AbstractBuilder<RerankRequest.Builder> implements ObjectBuilder<RerankRequest>
Builder for RerankRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • inferenceId

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

      API name: inference_id

    • input

      public final RerankRequest.Builder input(RerankInput value)
      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

    • 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 RerankRequest.Builder query(RerankQuery value)
      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

    • 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

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

      API name: return_documents

    • taskSettings

      public final RerankRequest.Builder taskSettings(@Nullable JsonData value)
      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

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

      API name: timeout

    • timeout

      The amount of time to wait for the inference request to complete.

      API name: timeout

    • topN

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

      API name: top_n

    • self

      protected RerankRequest.Builder self()
      Specified by:
      self in class RequestBase.AbstractBuilder<RerankRequest.Builder>
    • build

      public RerankRequest build()
      Builds a RerankRequest.
      Specified by:
      build in interface ObjectBuilder<RerankRequest>
      Throws:
      NullPointerException - if some of the required fields are null.