Class AzureOpenAiEmbeddingModel
java.lang.Object
io.quarkiverse.langchain4j.azure.openai.AzureOpenAiEmbeddingModel
- All Implemented Interfaces:
dev.langchain4j.model.embedding.EmbeddingModel,dev.langchain4j.model.embedding.TokenCountEstimator
public class AzureOpenAiEmbeddingModel
extends Object
implements dev.langchain4j.model.embedding.EmbeddingModel, dev.langchain4j.model.embedding.TokenCountEstimator
Represents an OpenAI embedding model, hosted on Azure, such as text-embedding-ada-002.
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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()dev.langchain4j.model.output.Response<List<dev.langchain4j.data.embedding.Embedding>>Embeds the provided text segments, processing a maximum of 16 segments at a time.intestimateTokenCount(String text) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.langchain4j.model.embedding.EmbeddingModel
dimension, embed, embedMethods inherited from interface dev.langchain4j.model.embedding.TokenCountEstimator
estimateTokenCount, estimateTokenCount
-
Constructor Details
-
AzureOpenAiEmbeddingModel
-
-
Method Details
-
embedAll
public 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. For more information, refer to the documentation here.- Specified by:
embedAllin interfacedev.langchain4j.model.embedding.EmbeddingModel- Parameters:
textSegments- A list of text segments.- Returns:
- A list of corresponding embeddings.
-
estimateTokenCount
- Specified by:
estimateTokenCountin interfacedev.langchain4j.model.embedding.TokenCountEstimator
-
builder
-