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.dimensions(Integer value) For anembeddingortext_embeddingtask, the number of dimensions the resulting output embeddings should have.embeddingType(JinaAIElementType value) For anembeddingortext_embeddingtask, the data type returned by the model.Required - The name of the model to use for the inference task.multimodalModel(Boolean value) For theembeddingtask, whether the model supports multimodal inputs.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.Builderself()similarity(JinaAISimilarityType value) For anembeddingortext_embeddingtask, the similarity measure.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods 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.
API name:
api_key -
modelId
Required - The name of the model to use for the inference task.API name:
model_id -
rateLimit
This setting helps to minimize the number of rate limit errors returned from JinaAI. By default, thejinaaiservice 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, thejinaaiservice sets the number of requests allowed per minute to 2000 for all task types.API name:
rate_limit -
similarity
For anembeddingortext_embeddingtask, 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_productsimilarity measure by default.API name:
similarity -
dimensions
For anembeddingortext_embeddingtask, 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
For anembeddingortext_embeddingtask, the data type returned by the model. Usebitfor binary embeddings, which are encoded as bytes with signed int8 precision. Usebinaryfor binary embeddings, which are encoded as bytes with signed int8 precision (this is a synonym ofbit). Usefloatfor the default float embeddings.API name:
embedding_type -
multimodalModel
For theembeddingtask, 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 thetext_embeddingtask (a list of strings). Setting this tofalseallows theembeddingtask to be used with models that do not support multimodal requests.API name:
multimodal_model -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<JinaAIServiceSettings.Builder>
-
build
Builds aJinaAIServiceSettings.- Specified by:
buildin interfaceObjectBuilder<JinaAIServiceSettings>- Throws:
NullPointerException- if some of the required fields are null.
-