Class AzureOpenAIServiceSettings.Builder
- All Implemented Interfaces:
WithJson<AzureOpenAIServiceSettings.Builder>,ObjectBuilder<AzureOpenAIServiceSettings>
- Enclosing class:
- AzureOpenAIServiceSettings
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.For OAuth 2.0 authorization using the client credentials grant flow.clientSecret(String value) For OAuth 2.0 authorization using the client credentials grant flow.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.For OAuth 2.0 authorization using the client credentials grant flow.For OAuth 2.0 authorization using the client credentials grant flow.protected AzureOpenAIServiceSettings.Builderself()For OAuth 2.0 authorization using the client credentials grant flow.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
A valid API key for your Azure OpenAI account.IMPORTANT: You must specify either
api_key,entra_id, orclient_secret. If you do not provide one or you provide more than one of them, you will receive an error when you try to create your endpoint.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 -
clientId
For OAuth 2.0 authorization using the client credentials grant flow. The application ID that's assigned to your app.IMPORTANT: To configure OAuth 2.0, you must specify client_id, scopes, tenant_id, and client_secret together. If one of the fields is missing, you will receive an error when you try to create your endpoint.
API name:
client_id -
clientSecret
For OAuth 2.0 authorization using the client credentials grant flow. The application secret that you created in the Microsoft app registration portal for your app.IMPORTANT: You must specify either
api_key,entra_id, orclient_secret. If you do not provide one or you provide more than one of them, you will receive an error when you try to create your endpoint.IMPORTANT: To configure OAuth 2.0, you must specify client_id, scopes, tenant_id, and client_secret together. If one of the fields is missing, you will receive an error when you try to create your endpoint.
API name:
client_secret -
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.IMPORTANT: You must specify either
api_key,entra_id, orclient_secret. If you do not provide one or you provide more than one of them, you will receive an error when you try to create your endpoint.API name:
entra_id -
rateLimit
This setting helps to minimize the number of rate limit errors returned from Azure. Theazureopenaiservice sets a default number of requests allowed per minute depending on the task type. Fortext_embedding, it is set to1440. Forcompletionandchat_completion, 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. Theazureopenaiservice sets a default number of requests allowed per minute depending on the task type. Fortext_embedding, it is set to1440. Forcompletionandchat_completion, 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 -
scopes
For OAuth 2.0 authorization using the client credentials grant flow. The resource identifier (application ID URI) of the resource you want, suffixed with .default For example:"scopes": [ "https://cognitiveservices.azure.com/.default" ]IMPORTANT: To configure OAuth 2.0, you must specify client_id, scopes, tenant_id, and client_secret together. If one of the fields is missing, you will receive an error when you try to create your endpoint.
API name:
scopesAdds all elements of
listtoscopes. -
scopes
For OAuth 2.0 authorization using the client credentials grant flow. The resource identifier (application ID URI) of the resource you want, suffixed with .default For example:"scopes": [ "https://cognitiveservices.azure.com/.default" ]IMPORTANT: To configure OAuth 2.0, you must specify client_id, scopes, tenant_id, and client_secret together. If one of the fields is missing, you will receive an error when you try to create your endpoint.
API name:
scopesAdds one or more values to
scopes. -
tenantId
For OAuth 2.0 authorization using the client credentials grant flow. The directory tenant the application plans to operate against.IMPORTANT: To configure OAuth 2.0, you must specify client_id, scopes, tenant_id, and client_secret together. If one of the fields is missing, you will receive an error when you try to create your endpoint.
API name:
tenant_id -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<AzureOpenAIServiceSettings.Builder>
-
build
Builds aAzureOpenAIServiceSettings.- Specified by:
buildin interfaceObjectBuilder<AzureOpenAIServiceSettings>- Throws:
NullPointerException- if some of the required fields are null.
-