Class AzureOpenAiStreamingChatModel.Builder
java.lang.Object
dev.langchain4j.model.azure.AzureOpenAiStreamingChatModel.Builder
- Enclosing class:
AzureOpenAiStreamingChatModel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the Azure OpenAI API key.build()customHeaders(Map<String, String> customHeaders) dataSources(List<com.azure.ai.openai.models.AzureChatExtensionConfiguration> dataSources) defaultRequestParameters(ChatRequestParameters parameters) deploymentName(String deploymentName) Sets the deployment name in Azure OpenAI.Sets the Azure OpenAI endpoint.enhancements(com.azure.ai.openai.models.AzureChatEnhancementConfiguration enhancements) frequencyPenalty(Double frequencyPenalty) httpClientProvider(com.azure.core.http.HttpClientProvider httpClientProvider) Sets theHttpClientProviderto use for creating the HTTP client to communicate with the OpenAI api.listeners(List<ChatModelListener> listeners) logRequestsAndResponses(boolean logRequestsAndResponses) maxCompletionTokens(Integer maxCompletionTokens) maxRetries(Integer maxRetries) nonAzureApiKey(String nonAzureApiKey) Used to authenticate with the OpenAI service, instead of Azure OpenAI.openAIAsyncClient(com.azure.ai.openai.OpenAIAsyncClient openAIAsyncClient) Sets the Azure OpenAI client.presencePenalty(Double presencePenalty) proxyOptions(com.azure.core.http.ProxyOptions proxyOptions) responseFormat(ResponseFormat responseFormat) retryOptions(com.azure.core.http.policy.RetryOptions retryOptions) serviceVersion(String serviceVersion) Sets the Azure OpenAI API service version.strictJsonSchema(Boolean strictJsonSchema) supportedCapabilities(Capability... supportedCapabilities) supportedCapabilities(Set<Capability> supportedCapabilities) temperature(Double temperature) 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
-
defaultRequestParameters
public AzureOpenAiStreamingChatModel.Builder defaultRequestParameters(ChatRequestParameters parameters) -
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
-
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 AzureOpenAiStreamingChatModel.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
-
httpClientProvider
public AzureOpenAiStreamingChatModel.Builder httpClientProvider(com.azure.core.http.HttpClientProvider httpClientProvider) Sets theHttpClientProviderto use for creating the HTTP client to communicate with the OpenAI api.- Parameters:
httpClientProvider- TheHttpClientProviderto use- Returns:
- builder
-
deploymentName
Sets the deployment name in Azure OpenAI. This is a mandatory parameter.- Parameters:
deploymentName- The Deployment name.- Returns:
- builder
-
maxTokens
-
maxCompletionTokens
-
temperature
-
topP
-
logitBias
-
user
-
stop
-
presencePenalty
-
frequencyPenalty
-
dataSources
public AzureOpenAiStreamingChatModel.Builder dataSources(List<com.azure.ai.openai.models.AzureChatExtensionConfiguration> dataSources) -
enhancements
public AzureOpenAiStreamingChatModel.Builder enhancements(com.azure.ai.openai.models.AzureChatEnhancementConfiguration enhancements) -
seed
-
responseFormat
-
strictJsonSchema
-
timeout
-
maxRetries
-
retryOptions
public AzureOpenAiStreamingChatModel.Builder retryOptions(com.azure.core.http.policy.RetryOptions retryOptions) -
proxyOptions
public AzureOpenAiStreamingChatModel.Builder proxyOptions(com.azure.core.http.ProxyOptions proxyOptions) -
logRequestsAndResponses
public AzureOpenAiStreamingChatModel.Builder logRequestsAndResponses(boolean logRequestsAndResponses) -
openAIAsyncClient
public AzureOpenAiStreamingChatModel.Builder openAIAsyncClient(com.azure.ai.openai.OpenAIAsyncClient openAIAsyncClient) Sets the Azure OpenAI client. This is an optional parameter, if you need more flexibility than using the endpoint, serviceVersion, apiKey, deploymentName parameters.- Parameters:
openAIAsyncClient- The Azure OpenAI client.- Returns:
- builder
-
userAgentSuffix
-
listeners
-
customHeaders
-
supportedCapabilities
public AzureOpenAiStreamingChatModel.Builder supportedCapabilities(Set<Capability> supportedCapabilities) -
supportedCapabilities
public AzureOpenAiStreamingChatModel.Builder supportedCapabilities(Capability... supportedCapabilities) -
build
-