Interface GPTEmbeddingService
-
- All Known Implementing Classes:
GPTEmbeddingServiceImpl
public interface GPTEmbeddingServiceMethods related to embeddings. Based on the low level serviceGPTChatCompletionService.getEmbeddings(List, GPTConfiguration)but with a more convenient API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceGPTEmbeddingService.EmbeddingsCacheOptional cache for embedding values.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<String>findMostRelated(String query, List<String> comparedStrings, int limit, GPTConfiguration configuration, GPTEmbeddingService.EmbeddingsCache cache)Determines the at most limit to query semantically closest of the comparedStrings according to the embedding service.List<float[]>getEmbeddings(List<String> texts, GPTConfiguration configuration, GPTEmbeddingService.EmbeddingsCache cache)Get embeddings for the given texts.
-
-
-
Method Detail
-
getEmbeddings
List<float[]> getEmbeddings(List<String> texts, @Nullable GPTConfiguration configuration, @Nullable GPTEmbeddingService.EmbeddingsCache cache) throws GPTException
Get embeddings for the given texts.- Parameters:
texts- the texts to get embeddings forconfiguration- the configuration to use- Returns:
- the embeddings for the given texts
- Throws:
GPTException- if an error occurs
-
findMostRelated
List<String> findMostRelated(String query, List<String> comparedStrings, int limit, @Nullable GPTConfiguration configuration, @Nullable GPTEmbeddingService.EmbeddingsCache cache) throws GPTException
Determines the at most limit to query semantically closest of the comparedStrings according to the embedding service.- Throws:
GPTException
-
-