public class AzureOpenAiEmbeddingModel extends Object implements dev.langchain4j.model.embedding.EmbeddingModel, dev.langchain4j.model.embedding.TokenCountEstimator
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
AzureOpenAiEmbeddingModel.Builder |
| Constructor and Description |
|---|
AzureOpenAiEmbeddingModel(String baseUrl,
String apiVersion,
String apiKey,
dev.langchain4j.model.Tokenizer tokenizer,
Duration timeout,
Integer maxRetries,
Proxy proxy,
Boolean logRequests,
Boolean logResponses) |
| Modifier and Type | Method and Description |
|---|---|
static AzureOpenAiEmbeddingModel.Builder |
builder() |
dev.langchain4j.model.output.Response<List<dev.langchain4j.data.embedding.Embedding>> |
embedAll(List<dev.langchain4j.data.segment.TextSegment> textSegments)
Embeds the provided text segments, processing a maximum of 16 segments at a time.
|
int |
estimateTokenCount(String text) |
public dev.langchain4j.model.output.Response<List<dev.langchain4j.data.embedding.Embedding>> embedAll(List<dev.langchain4j.data.segment.TextSegment> textSegments)
embedAll in interface dev.langchain4j.model.embedding.EmbeddingModeltextSegments - A list of text segments.public int estimateTokenCount(String text)
estimateTokenCount in interface dev.langchain4j.model.embedding.TokenCountEstimatorpublic static AzureOpenAiEmbeddingModel.Builder builder()
Copyright © 2023. All rights reserved.