Class AzureOpenAIServiceSettings.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<AzureOpenAIServiceSettings.Builder>
co.elastic.clients.elasticsearch.inference.AzureOpenAIServiceSettings.Builder
- All Implemented Interfaces:
WithJson<AzureOpenAIServiceSettings.Builder>
,ObjectBuilder<AzureOpenAIServiceSettings>
- Enclosing class:
- AzureOpenAIServiceSettings
public static class AzureOpenAIServiceSettings.Builder
extends WithJsonObjectBuilderBase<AzureOpenAIServiceSettings.Builder>
implements ObjectBuilder<AzureOpenAIServiceSettings>
Builder for
AzureOpenAIServiceSettings
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA valid API key for your Azure OpenAI account.apiVersion
(String value) Required - The Azure API version ID to use.build()
Builds aAzureOpenAIServiceSettings
.deploymentId
(String value) Required - The deployment name of your deployed models.A valid Microsoft Entra token.rateLimit
(RateLimitSetting value) This setting helps to minimize the number of rate limit errors returned from Azure.This setting helps to minimize the number of rate limit errors returned from Azure.resourceName
(String value) Required - The name of your Azure OpenAI resource.protected AzureOpenAIServiceSettings.Builder
self()
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
A valid API key for your Azure OpenAI account. You must specify eitherapi_key
orentra_id
. If you do not provide either or you provide both, you will receive an error when you try to create your model.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
-
apiVersion
Required - The Azure API version ID to use. It is recommended to use the latest supported non-preview version.API name:
api_version
-
deploymentId
Required - The deployment name of your deployed models. Your Azure OpenAI deployments can be found though the Azure OpenAI Studio portal that is linked to your subscription.API name:
deployment_id
-
entraId
A valid Microsoft Entra token. You must specify eitherapi_key
orentra_id
. If you do not provide either or you provide both, you will receive an error when you try to create your model.API name:
entra_id
-
rateLimit
This setting helps to minimize the number of rate limit errors returned from Azure. Theazureopenai
service sets a default number of requests allowed per minute depending on the task type. Fortext_embedding
, it is set to1440
. Forcompletion
, it is set to120
.API name:
rate_limit
-
rateLimit
public final AzureOpenAIServiceSettings.Builder rateLimit(Function<RateLimitSetting.Builder, ObjectBuilder<RateLimitSetting>> fn) This setting helps to minimize the number of rate limit errors returned from Azure. Theazureopenai
service sets a default number of requests allowed per minute depending on the task type. Fortext_embedding
, it is set to1440
. Forcompletion
, it is set to120
.API name:
rate_limit
-
resourceName
Required - The name of your Azure OpenAI resource. You can find this from the list of resources in the Azure Portal for your subscription.API name:
resource_name
-
self
- Specified by:
self
in classWithJsonObjectBuilderBase<AzureOpenAIServiceSettings.Builder>
-
build
Builds aAzureOpenAIServiceSettings
.- Specified by:
build
in interfaceObjectBuilder<AzureOpenAIServiceSettings>
- Throws:
NullPointerException
- if some of the required fields are null.
-