Class JinaAIServiceSettings

java.lang.Object
co.elastic.clients.elasticsearch.inference.JinaAIServiceSettings
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class JinaAIServiceSettings extends Object implements JsonpSerializable
See Also:
  • Field Details

  • Method Details

    • of

    • apiKey

      public final String apiKey()
      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 String modelId()
      Required - The name of the model to use for the inference task.

      API name: model_id

    • rateLimit

      @Nullable public final RateLimitSetting 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

      @Nullable public final JinaAISimilarityType similarity()
      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

      @Nullable public final Integer dimensions()
      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

      @Nullable public final JinaAIElementType embeddingType()
      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

      @Nullable public final Boolean multimodalModel()
      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

    • 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)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • rebuild

      Returns:
      New JinaAIServiceSettings.Builder initialized with field values of this instance
    • setupJinaAIServiceSettingsDeserializer

      protected static void setupJinaAIServiceSettingsDeserializer(ObjectDeserializer<JinaAIServiceSettings.Builder> op)