Class JinaAIServiceSettings.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • apiKey

      public final JinaAIServiceSettings.Builder apiKey(String value)
      Required - A valid API key of your JinaAI account.

      IMPORTANT: You need to provide the API key only once, during the inference model creation. The get inference endpoint API does not retrieve your API key.

      API name: api_key

    • modelId

      public final JinaAIServiceSettings.Builder modelId(String value)
      Required - The name of the model to use for the inference task.

      API name: model_id

    • rateLimit

      public final JinaAIServiceSettings.Builder rateLimit(@Nullable RateLimitSetting value)
      This setting helps to minimize the number of rate limit errors returned from JinaAI. By default, the jinaai service sets the number of requests allowed per minute to 2000 for all task types.

      API name: rate_limit

    • rateLimit

      This setting helps to minimize the number of rate limit errors returned from JinaAI. By default, the jinaai service sets the number of requests allowed per minute to 2000 for all task types.

      API name: rate_limit

    • similarity

      public final JinaAIServiceSettings.Builder similarity(@Nullable JinaAISimilarityType value)
      For an embedding or text_embedding task, the similarity measure. One of cosine, dot_product, l2_norm. The default values varies with the embedding type. For example, a float embedding type uses a dot_product similarity measure by default.

      API name: similarity

    • dimensions

      public final JinaAIServiceSettings.Builder dimensions(@Nullable Integer value)
      For an embedding or text_embedding task, the number of dimensions the resulting output embeddings should have. By default, the model's standard output dimension is used. Refer to the Jina documentation for more information.

      API name: dimensions

    • embeddingType

      public final JinaAIServiceSettings.Builder embeddingType(@Nullable JinaAIElementType value)
      For an embedding or text_embedding task, the data type returned by the model. Use bit for binary embeddings, which are encoded as bytes with signed int8 precision. Use binary for binary embeddings, which are encoded as bytes with signed int8 precision (this is a synonym of bit). Use float for the default float embeddings.

      API name: embedding_type

    • multimodalModel

      public final JinaAIServiceSettings.Builder multimodalModel(@Nullable Boolean value)
      For the embedding task, whether the model supports multimodal inputs. If true, requests sent to the Jina model will use the multimodal request format (a list of objects). If false, requests sent to the model will use the same format as the text_embedding task (a list of strings). Setting this to false allows the embedding task to be used with models that do not support multimodal requests.

      API name: multimodal_model

    • self

      Specified by:
      self in class WithJsonObjectBuilderBase<JinaAIServiceSettings.Builder>
    • build

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