public class AzureOpenAiLanguageModel extends Object implements dev.langchain4j.model.language.LanguageModel, dev.langchain4j.model.language.TokenCountEstimator
AzureOpenAiChatModel instead,
as it offers more advanced features like function calling, multi-turn conversations, etc.
Mandatory parameters for initialization are: baseUrl, apiVersion and apiKey.
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
AzureOpenAiLanguageModel.Builder |
| Constructor and Description |
|---|
AzureOpenAiLanguageModel(String baseUrl,
String apiVersion,
String apiKey,
dev.langchain4j.model.Tokenizer tokenizer,
Double temperature,
Duration timeout,
Integer maxRetries,
Proxy proxy,
Boolean logRequests,
Boolean logResponses) |
| Modifier and Type | Method and Description |
|---|---|
static AzureOpenAiLanguageModel.Builder |
builder() |
int |
estimateTokenCount(String prompt) |
dev.langchain4j.model.output.Response<String> |
generate(String prompt) |
public dev.langchain4j.model.output.Response<String> generate(String prompt)
generate in interface dev.langchain4j.model.language.LanguageModelpublic int estimateTokenCount(String prompt)
estimateTokenCount in interface dev.langchain4j.model.language.TokenCountEstimatorpublic static AzureOpenAiLanguageModel.Builder builder()
Copyright © 2023. All rights reserved.