Class JinaAITaskSettings.Builder

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

public static class JinaAITaskSettings.Builder extends WithJsonObjectBuilderBase<JinaAITaskSettings.Builder> implements ObjectBuilder<JinaAITaskSettings>
Builder for JinaAITaskSettings.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • returnDocuments

      public final JinaAITaskSettings.Builder returnDocuments(@Nullable Boolean value)
      For a rerank task, return the doc text within the results.

      API name: return_documents

    • inputType

      public final JinaAITaskSettings.Builder inputType(@Nullable JinaAITextEmbeddingTask value)
      For an embedding or text_embedding task, the task passed to the model. Valid values are:
      • classification: Use it for embeddings passed through a classifier.
      • clustering: Use it for the embeddings run through a clustering algorithm.
      • ingest: Use it for storing document embeddings in a vector database.
      • search: Use it for storing embeddings of search queries run against a vector database to find relevant documents.

      API name: input_type

    • lateChunking

      public final JinaAITaskSettings.Builder lateChunking(@Nullable Boolean value)
      For an embedding or text_embedding task, controls when text is split into chunks. When set to true, a request from Elasticsearch contains only chunks related to a single document. Instead of batching chunks across documents, Elasticsearch sends them in separate requests. This ensures that chunk embeddings retain context from the entire document, improving semantic quality.

      If a document exceeds the model's context limits, or if the document contains non-text inputs (relevant when using the multimodal embedding task), late chunking is automatically disabled for that document only and standard chunking is used instead.

      If not specified, defaults to false.

      API name: late_chunking

    • topN

      public final JinaAITaskSettings.Builder topN(@Nullable Integer value)
      For a rerank task, the number of most relevant documents to return. It defaults to the number of the documents. If this inference endpoint is used in a text_similarity_reranker retriever query and top_n is set, it must be greater than or equal to rank_window_size in the query.

      API name: top_n

    • self

      protected JinaAITaskSettings.Builder self()
      Specified by:
      self in class WithJsonObjectBuilderBase<JinaAITaskSettings.Builder>
    • build

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