Class AzureOpenAiChatModel
java.lang.Object
io.quarkiverse.langchain4j.azure.openai.AzureOpenAiChatModel
- All Implemented Interfaces:
dev.langchain4j.model.chat.ChatModel
Represents an OpenAI language model, hosted on Azure, that has a chat completion interface, such as gpt-3.5-turbo.
Mandatory parameters for initialization are: apiVersion
, apiKey
, and either endpoint
OR
resourceName
and deploymentName
.
There are two primary authentication methods to access Azure OpenAI:
1. API Key Authentication: For this type of authentication, HTTP requests must include the API Key in the "api-key" HTTP header.
2. Azure Active Directory Authentication: For this type of authentication, HTTP requests must include the authentication/access token in the "Authorization" HTTP header.
Please note, that currently, only API Key authentication is supported by this class, second authentication option will be supported later.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAzureOpenAiChatModel
(String endpoint, String apiVersion, String apiKey, String adToken, dev.langchain4j.model.TokenCountEstimator tokenizer, Double temperature, Double topP, Integer maxTokens, Double presencePenalty, Double frequencyPenalty, Duration timeout, Integer maxRetries, Proxy proxy, String responseFormat, Boolean logRequests, Boolean logResponses, String configName, List<dev.langchain4j.model.chat.listener.ChatModelListener> listeners) -
Method Summary
Modifier and TypeMethodDescriptionstatic AzureOpenAiChatModel.Builder
builder()
dev.langchain4j.model.chat.response.ChatResponse
doChat
(dev.langchain4j.model.chat.request.ChatRequest chatRequest) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.model.chat.ChatModel
chat, chat, chat, chat, defaultRequestParameters, listeners, provider, supportedCapabilities
-
Constructor Details
-
AzureOpenAiChatModel
public AzureOpenAiChatModel(String endpoint, String apiVersion, String apiKey, String adToken, dev.langchain4j.model.TokenCountEstimator tokenizer, Double temperature, Double topP, Integer maxTokens, Double presencePenalty, Double frequencyPenalty, Duration timeout, Integer maxRetries, Proxy proxy, String responseFormat, Boolean logRequests, Boolean logResponses, String configName, List<dev.langchain4j.model.chat.listener.ChatModelListener> listeners)
-
-
Method Details
-
doChat
public dev.langchain4j.model.chat.response.ChatResponse doChat(dev.langchain4j.model.chat.request.ChatRequest chatRequest) - Specified by:
doChat
in interfacedev.langchain4j.model.chat.ChatModel
-
builder
-