Class Ai21ServiceSettings.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<Ai21ServiceSettings.Builder>
co.elastic.clients.elasticsearch.inference.Ai21ServiceSettings.Builder
- All Implemented Interfaces:
WithJson<Ai21ServiceSettings.Builder>,ObjectBuilder<Ai21ServiceSettings>
- Enclosing class:
- Ai21ServiceSettings
public static class Ai21ServiceSettings.Builder
extends WithJsonObjectBuilderBase<Ai21ServiceSettings.Builder>
implements ObjectBuilder<Ai21ServiceSettings>
Builder for
Ai21ServiceSettings.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA valid API key for accessing AI21 API.build()Builds aAi21ServiceSettings.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 the AI21 API.This setting helps to minimize the number of rate limit errors returned from the AI21 API.protected Ai21ServiceSettings.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
-
modelId
Required - The name of the model to use for the inference task. Refer to the AI21 models documentation for the list of supported models and versions. Service has been tested and confirmed to be working forcompletionandchat_completiontasks with the following models:jamba-minijamba-large
API name:
model_id -
apiKey
A valid API key for accessing AI21 API.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 -
rateLimit
This setting helps to minimize the number of rate limit errors returned from the AI21 API. By default, theai21service sets the number of requests allowed per minute to 200. Please refer to AI21 documentation for more details.API name:
rate_limit -
rateLimit
public final Ai21ServiceSettings.Builder rateLimit(Function<RateLimitSetting.Builder, ObjectBuilder<RateLimitSetting>> fn) This setting helps to minimize the number of rate limit errors returned from the AI21 API. By default, theai21service sets the number of requests allowed per minute to 200. Please refer to AI21 documentation for more details.API name:
rate_limit -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<Ai21ServiceSettings.Builder>
-
build
Builds aAi21ServiceSettings.- Specified by:
buildin interfaceObjectBuilder<Ai21ServiceSettings>- Throws:
NullPointerException- if some of the required fields are null.
-