Class JinaAIServiceSettings.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<JinaAIServiceSettings.Builder>
co.elastic.clients.elasticsearch.inference.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>
Builder for
JinaAIServiceSettings
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRequired - A valid API key of your JinaAI account.build()
Builds aJinaAIServiceSettings
.The name of the model to use for the inference task.rateLimit
(RateLimitSetting value) This setting helps to minimize the number of rate limit errors returned from JinaAI.This setting helps to minimize the number of rate limit errors returned from JinaAI.protected JinaAIServiceSettings.Builder
self()
similarity
(JinaAISimilarityType value) For atext_embedding
task, the similarity measure.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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. After creating the inference model, you cannot change the associated API key. If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.
API name:
api_key
-
modelId
The name of the model to use for the inference task. For arerank
task, it is required. For atext_embedding
task, it is optional.API name:
model_id
-
rateLimit
This setting helps to minimize the number of rate limit errors returned from JinaAI. By default, thejinaai
service sets the number of requests allowed per minute to 2000 for all task types.API name:
rate_limit
-
rateLimit
public final JinaAIServiceSettings.Builder rateLimit(Function<RateLimitSetting.Builder, ObjectBuilder<RateLimitSetting>> fn) This setting helps to minimize the number of rate limit errors returned from JinaAI. By default, thejinaai
service sets the number of requests allowed per minute to 2000 for all task types.API name:
rate_limit
-
similarity
For atext_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 adot_product
similarity measure by default.API name:
similarity
-
self
- Specified by:
self
in classWithJsonObjectBuilderBase<JinaAIServiceSettings.Builder>
-
build
Builds aJinaAIServiceSettings
.- Specified by:
build
in interfaceObjectBuilder<JinaAIServiceSettings>
- Throws:
NullPointerException
- if some of the required fields are null.
-