Class CohereTaskSettings.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • inputType

      public final CohereTaskSettings.Builder inputType(@Nullable CohereInputType value)
      For a text_embedding task, the type of input passed to the model. Valid values are:
      • classification: Use it for embeddings passed through a text 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.

      IMPORTANT: The input_type field is required when using embedding models v3 and higher.

      API name: input_type

    • returnDocuments

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

      API name: return_documents

    • topN

      public final CohereTaskSettings.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

    • truncate

      public final CohereTaskSettings.Builder truncate(@Nullable CohereTruncateType value)
      For a text_embedding task, the method to handle inputs longer than the maximum token length. Valid values are:
      • END: When the input exceeds the maximum input token length, the end of the input is discarded.
      • NONE: When the input exceeds the maximum input token length, an error is returned.
      • START: When the input exceeds the maximum input token length, the start of the input is discarded.

      API name: truncate

    • self

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

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