Class ContextualAIServiceSettings.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<ContextualAIServiceSettings.Builder>
co.elastic.clients.elasticsearch.inference.ContextualAIServiceSettings.Builder
- All Implemented Interfaces:
WithJson<ContextualAIServiceSettings.Builder>,ObjectBuilder<ContextualAIServiceSettings>
- Enclosing class:
- ContextualAIServiceSettings
public static class ContextualAIServiceSettings.Builder
extends WithJsonObjectBuilderBase<ContextualAIServiceSettings.Builder>
implements ObjectBuilder<ContextualAIServiceSettings>
Builder for
ContextualAIServiceSettings.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRequired - A valid API key for your Contexutual AI account.build()Builds aContextualAIServiceSettings.Required - 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 Contextual AI.This setting helps to minimize the number of rate limit errors returned from Contextual AI.protected ContextualAIServiceSettings.Builderself()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 Contexutual AI 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
Required - The name of the model to use for the inference task. Refer to the Contextual AI documentation for the list of available rerank models.API name:
model_id -
rateLimit
This setting helps to minimize the number of rate limit errors returned from Contextual AI. Thecontextualaiservice sets a default number of requests allowed per minute depending on the task type. Forrerank, it is set to1000.API name:
rate_limit -
rateLimit
public final ContextualAIServiceSettings.Builder rateLimit(Function<RateLimitSetting.Builder, ObjectBuilder<RateLimitSetting>> fn) This setting helps to minimize the number of rate limit errors returned from Contextual AI. Thecontextualaiservice sets a default number of requests allowed per minute depending on the task type. Forrerank, it is set to1000.API name:
rate_limit -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<ContextualAIServiceSettings.Builder>
-
build
Builds aContextualAIServiceSettings.- Specified by:
buildin interfaceObjectBuilder<ContextualAIServiceSettings>- Throws:
NullPointerException- if some of the required fields are null.
-