Class OpenShiftAiServiceSettings.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<OpenShiftAiServiceSettings.Builder>
co.elastic.clients.elasticsearch.inference.OpenShiftAiServiceSettings.Builder
- All Implemented Interfaces:
WithJson<OpenShiftAiServiceSettings.Builder>,ObjectBuilder<OpenShiftAiServiceSettings>
- Enclosing class:
- OpenShiftAiServiceSettings
public static class OpenShiftAiServiceSettings.Builder
extends WithJsonObjectBuilderBase<OpenShiftAiServiceSettings.Builder>
implements ObjectBuilder<OpenShiftAiServiceSettings>
Builder for
OpenShiftAiServiceSettings.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRequired - A valid API key for your OpenShift AI endpoint.build()Builds aOpenShiftAiServiceSettings.maxInputTokens(Integer value) For atext_embeddingtask, the maximum number of tokens per input before chunking occurs.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 the OpenShift AI API.This setting helps to minimize the number of rate limit errors returned from the OpenShift AI API.protected OpenShiftAiServiceSettings.Builderself()For atext_embeddingtask, the similarity measure.Required - The URL of the OpenShift AI hosted model endpoint.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 for your OpenShift AI endpoint. Can be found inToken authenticationsection of model related information.API name:
api_key -
url
Required - The URL of the OpenShift AI hosted model endpoint.API name:
url -
modelId
The name of the model to use for the inference task. Refer to the hosted model's documentation for the name if needed. Service has been tested and confirmed to be working with the following models:- For
text_embeddingtask -gritlm-7b. - For
completionandchat_completiontasks -llama-31-8b-instruct. - For
reranktask -bge-reranker-v2-m3.
API name:
model_id - For
-
maxInputTokens
For atext_embeddingtask, the maximum number of tokens per input before chunking occurs.API name:
max_input_tokens -
similarity
public final OpenShiftAiServiceSettings.Builder similarity(@Nullable OpenShiftAiSimilarityType value) For atext_embeddingtask, the similarity measure. One of cosine, dot_product, l2_norm. If not specified, the default dot_product value is used.API name:
similarity -
rateLimit
This setting helps to minimize the number of rate limit errors returned from the OpenShift AI API. By default, theopenshift_aiservice sets the number of requests allowed per minute to 3000.API name:
rate_limit -
rateLimit
public final OpenShiftAiServiceSettings.Builder rateLimit(Function<RateLimitSetting.Builder, ObjectBuilder<RateLimitSetting>> fn) This setting helps to minimize the number of rate limit errors returned from the OpenShift AI API. By default, theopenshift_aiservice sets the number of requests allowed per minute to 3000.API name:
rate_limit -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<OpenShiftAiServiceSettings.Builder>
-
build
Builds aOpenShiftAiServiceSettings.- Specified by:
buildin interfaceObjectBuilder<OpenShiftAiServiceSettings>- Throws:
NullPointerException- if some of the required fields are null.
-