Class AzureOpenAiEmbeddingModel
java.lang.Object
org.springframework.ai.embedding.AbstractEmbeddingModel
org.springframework.ai.azure.openai.AzureOpenAiEmbeddingModel
- All Implemented Interfaces:
EmbeddingModel, Model<EmbeddingRequest, EmbeddingResponse>
Azure Open AI Embedding Model implementation.
- Since:
- 1.0.0
- Author:
- Mark Pollack, Christian Tzolov, Thomas Vitale, Soby Chacko
-
Field Summary
Fields inherited from class AbstractEmbeddingModel
embeddingDimensions -
Constructor Summary
ConstructorsConstructorDescriptionAzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient) AzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient, MetadataMode metadataMode) AzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient, MetadataMode metadataMode, AzureOpenAiEmbeddingOptions options) AzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient, MetadataMode metadataMode, AzureOpenAiEmbeddingOptions options, io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Modifier and TypeMethodDescriptioncall(EmbeddingRequest embeddingRequest) Executes a method call to the AI model.float[]Embeds the given document's content into a vector.voidsetObservationConvention(EmbeddingModelObservationConvention observationConvention) Use the provided convention for reporting observation dataMethods inherited from class AbstractEmbeddingModel
dimensions, dimensionsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmbeddingModel
embed, embed, embed, embedForResponse
-
Constructor Details
-
AzureOpenAiEmbeddingModel
public AzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient) -
AzureOpenAiEmbeddingModel
public AzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient, MetadataMode metadataMode) -
AzureOpenAiEmbeddingModel
public AzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient, MetadataMode metadataMode, AzureOpenAiEmbeddingOptions options) -
AzureOpenAiEmbeddingModel
public AzureOpenAiEmbeddingModel(com.azure.ai.openai.OpenAIClient azureOpenAiClient, MetadataMode metadataMode, AzureOpenAiEmbeddingOptions options, io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
embed
Description copied from interface:EmbeddingModelEmbeds the given document's content into a vector.- Parameters:
document- the document to embed.- Returns:
- the embedded vector.
-
call
Description copied from interface:ModelExecutes a method call to the AI model.- Parameters:
embeddingRequest- the request object to be sent to the AI model- Returns:
- the response from the AI model
-
getDefaultOptions
-
setObservationConvention
Use the provided convention for reporting observation data- Parameters:
observationConvention- The provided convention
-