Package org.springframework.ai.embedding
Class EmbeddingUtil
java.lang.Object
org.springframework.ai.embedding.EmbeddingUtil
- Author:
- Christian Tzolov
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
dimensions
(EmbeddingClient embeddingClient, String modelName) Return the dimension of the requested embedding model name.
-
Constructor Details
-
EmbeddingUtil
public EmbeddingUtil()
-
-
Method Details
-
dimensions
Return the dimension of the requested embedding model name. If the model name is unknown uses the EmbeddingClient to perform a dummy EmbeddingClient#embed and count the response dimensions.- Parameters:
embeddingClient
- Fall-back client to determine, empirically the dimensions.modelName
- Embedding model name to retrieve the dimensions for.- Returns:
- Returns the embedding dimensions for the modelName.
-