Class AzureOpenAIServiceSettings

java.lang.Object
co.elastic.clients.elasticsearch.inference.AzureOpenAIServiceSettings
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class AzureOpenAIServiceSettings extends Object implements JsonpSerializable
See Also:
  • Field Details

  • Method Details

    • of

    • apiKey

      @Nullable public final String apiKey()
      A valid API key for your Azure OpenAI account.

      IMPORTANT: You must specify either api_key, entra_id, or client_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

      public final String 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

      @Nullable public final String 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

      @Nullable public final String 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, or client_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

      public final String 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

      @Nullable public final String entraId()
      A valid Microsoft Entra token.

      IMPORTANT: You must specify either api_key, entra_id, or client_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

      @Nullable public final RateLimitSetting rateLimit()
      This setting helps to minimize the number of rate limit errors returned from Azure. The azureopenai service sets a default number of requests allowed per minute depending on the task type. For text_embedding, it is set to 1440. For completion and chat_completion, it is set to 120.

      API name: rate_limit

    • resourceName

      public final String 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

      public final List<String> 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: scopes

    • tenantId

      @Nullable public final String 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

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • rebuild

      Returns:
      New AzureOpenAIServiceSettings.Builder initialized with field values of this instance
    • setupAzureOpenAIServiceSettingsDeserializer

      protected static void setupAzureOpenAIServiceSettingsDeserializer(ObjectDeserializer<AzureOpenAIServiceSettings.Builder> op)