Class HuggingFaceServiceSettings.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<HuggingFaceServiceSettings.Builder>
co.elastic.clients.elasticsearch.inference.HuggingFaceServiceSettings.Builder
- All Implemented Interfaces:
WithJson<HuggingFaceServiceSettings.Builder>
,ObjectBuilder<HuggingFaceServiceSettings>
- Enclosing class:
- HuggingFaceServiceSettings
public static class HuggingFaceServiceSettings.Builder
extends WithJsonObjectBuilderBase<HuggingFaceServiceSettings.Builder>
implements ObjectBuilder<HuggingFaceServiceSettings>
Builder for
HuggingFaceServiceSettings
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRequired - A valid access token for your HuggingFace account.build()
Builds aHuggingFaceServiceSettings
.rateLimit
(RateLimitSetting value) This setting helps to minimize the number of rate limit errors returned from Hugging Face.This setting helps to minimize the number of rate limit errors returned from Hugging Face.protected HuggingFaceServiceSettings.Builder
self()
Required - The URL endpoint to use for the requests.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 access token for your HuggingFace account. You can create or find your access tokens on the HuggingFace settings page.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 Hugging Face. By default, thehugging_face
service sets the number of requests allowed per minute to 3000.API name:
rate_limit
-
rateLimit
public final HuggingFaceServiceSettings.Builder rateLimit(Function<RateLimitSetting.Builder, ObjectBuilder<RateLimitSetting>> fn) This setting helps to minimize the number of rate limit errors returned from Hugging Face. By default, thehugging_face
service sets the number of requests allowed per minute to 3000.API name:
rate_limit
-
url
Required - The URL endpoint to use for the requests.API name:
url
-
self
- Specified by:
self
in classWithJsonObjectBuilderBase<HuggingFaceServiceSettings.Builder>
-
build
Builds aHuggingFaceServiceSettings
.- Specified by:
build
in interfaceObjectBuilder<HuggingFaceServiceSettings>
- Throws:
NullPointerException
- if some of the required fields are null.
-