Package dev.langchain4j.model.azure
Class AzureOpenAiAudioTranscriptionModel.Builder
java.lang.Object
dev.langchain4j.model.azure.AzureOpenAiAudioTranscriptionModel.Builder
- Enclosing class:
AzureOpenAiAudioTranscriptionModel
Builder for
AzureOpenAiAudioTranscriptionModel
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the Azure OpenAI API key.build()
Builds a new instance ofAzureOpenAiAudioTranscriptionModel
.customHeaders
(Map<String, String> customHeaders) deploymentName
(String deploymentName) Sets the deployment name in Azure OpenAI.Sets the Azure OpenAI endpoint.httpClientProvider
(com.azure.core.http.HttpClientProvider httpClientProvider) Sets theHttpClientProvider
to use for creating the HTTP client to communicate with the OpenAI api.logRequestsAndResponses
(Boolean logRequestsAndResponses) maxRetries
(Integer maxRetries) nonAzureApiKey
(String nonAzureApiKey) Used to authenticate with the OpenAI service, instead of Azure OpenAI.openAIClient
(com.azure.ai.openai.OpenAIClient openAIClient) proxyOptions
(com.azure.core.http.ProxyOptions proxyOptions) responseFormat
(com.azure.ai.openai.models.AudioTranscriptionFormat format) Sets the response format for the transcription.retryOptions
(com.azure.core.http.policy.RetryOptions retryOptions) serviceVersion
(String serviceVersion) Sets the Azure OpenAI API service version.tokenCredential
(com.azure.core.credential.TokenCredential tokenCredential) Used to authenticate to Azure OpenAI with Azure Active Directory credentials.userAgentSuffix
(String userAgentSuffix)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
endpoint
Sets the Azure OpenAI endpoint. This is a mandatory parameter.- Parameters:
endpoint
- The Azure OpenAI endpoint in the format: https://{resource}.openai.azure.com/- Returns:
- builder
-
httpClientProvider
public AzureOpenAiAudioTranscriptionModel.Builder httpClientProvider(com.azure.core.http.HttpClientProvider httpClientProvider) Sets theHttpClientProvider
to use for creating the HTTP client to communicate with the OpenAI api.- Parameters:
httpClientProvider
- TheHttpClientProvider
to use- Returns:
- builder
-
serviceVersion
Sets the Azure OpenAI API service version. This is a mandatory parameter.- Parameters:
serviceVersion
- The Azure OpenAI API service version in the format: 2023-05-15- Returns:
- builder
-
apiKey
Sets the Azure OpenAI API key.- Parameters:
apiKey
- The Azure OpenAI API key.- Returns:
- builder
-
nonAzureApiKey
Used to authenticate with the OpenAI service, instead of Azure OpenAI. This automatically sets the endpoint to https://api.openai.com/v1.- Parameters:
nonAzureApiKey
- The non-Azure OpenAI API key- Returns:
- builder
-
tokenCredential
public AzureOpenAiAudioTranscriptionModel.Builder tokenCredential(com.azure.core.credential.TokenCredential tokenCredential) Used to authenticate to Azure OpenAI with Azure Active Directory credentials.- Parameters:
tokenCredential
- the credentials to authenticate with Azure Active Directory- Returns:
- builder
-
deploymentName
Sets the deployment name in Azure OpenAI. This is a mandatory parameter.- Parameters:
deploymentName
- The Deployment name.- Returns:
- builder
-
responseFormat
public AzureOpenAiAudioTranscriptionModel.Builder responseFormat(com.azure.ai.openai.models.AudioTranscriptionFormat format) Sets the response format for the transcription.- Parameters:
format
- The response format- Returns:
- builder
-
timeout
-
maxRetries
- See Also:
-
retryOptions
public AzureOpenAiAudioTranscriptionModel.Builder retryOptions(com.azure.core.http.policy.RetryOptions retryOptions) -
proxyOptions
public AzureOpenAiAudioTranscriptionModel.Builder proxyOptions(com.azure.core.http.ProxyOptions proxyOptions) -
logRequestsAndResponses
public AzureOpenAiAudioTranscriptionModel.Builder logRequestsAndResponses(Boolean logRequestsAndResponses) -
openAIClient
public AzureOpenAiAudioTranscriptionModel.Builder openAIClient(com.azure.ai.openai.OpenAIClient openAIClient) -
userAgentSuffix
-
customHeaders
-
build
Builds a new instance ofAzureOpenAiAudioTranscriptionModel
.- Returns:
- A new model instance
-