Class EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder
- Enclosing class:
EmbeddingStoreContentRetriever
-
Method Summary
Modifier and TypeMethodDescriptionbuild()displayName(String displayName) dynamicFilter(Function<Query, Filter> dynamicFilter) dynamicMaxResults(Function<Query, Integer> dynamicMaxResults) dynamicMinScore(Function<Query, Double> dynamicMinScore) embeddingInputType(EmbeddingInputType embeddingInputType) Embeds the query with the givenEmbeddingInputType(typicallyEmbeddingInputType.QUERY), so providers that encode queries and documents differently can produce a query-optimized embedding.embeddingModel(EmbeddingModel embeddingModel) embeddingStore(EmbeddingStore<TextSegment> embeddingStore) maxResults(Integer maxResults) offloadBlocking(boolean offloadBlocking) Controls whatEmbeddingStoreContentRetriever.retrieveAsync(Query)does when theEmbeddingModelorEmbeddingStoreis not genuinely asynchronous (does not implementdoEmbedAsync/searchAsync).
-
Method Details
-
embeddingInputType
public EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder embeddingInputType(EmbeddingInputType embeddingInputType) Embeds the query with the givenEmbeddingInputType(typicallyEmbeddingInputType.QUERY), so providers that encode queries and documents differently can produce a query-optimized embedding.When left
null(the default), no input type is sent. If set, the chosenEmbeddingModelmustsupportthe input type parameter, otherwise the query embedding fails fast. -
maxResults
public EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder maxResults(Integer maxResults) -
minScore
public EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder minScore(Double minScore) -
filter
-
displayName
public EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder displayName(String displayName) -
embeddingStore
public EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder embeddingStore(EmbeddingStore<TextSegment> embeddingStore) -
embeddingModel
public EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder embeddingModel(EmbeddingModel embeddingModel) -
dynamicMaxResults
public EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder dynamicMaxResults(Function<Query, Integer> dynamicMaxResults) -
dynamicMinScore
public EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder dynamicMinScore(Function<Query, Double> dynamicMinScore) -
dynamicFilter
public EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder dynamicFilter(Function<Query, Filter> dynamicFilter) -
offloadBlocking
@Experimental public EmbeddingStoreContentRetriever.EmbeddingStoreContentRetrieverBuilder offloadBlocking(boolean offloadBlocking) Controls whatEmbeddingStoreContentRetriever.retrieveAsync(Query)does when theEmbeddingModelorEmbeddingStoreis not genuinely asynchronous (does not implementdoEmbedAsync/searchAsync).By default (
false),retrieveAsyncfails with anUnsupportedFeatureExceptionnaming the blocking component, so a not-truly-async pipeline is never silently made "async" by parking a thread. Set totrueto instead offload only the blocking component(s) - the embedding call and/or the store search - to the shared default executor (virtual threads on Java 21+, platform threads on 17-20), while any async component keeps running on its native path. A deliberate opt-in to blocking-on-a-(virtual)-thread; has no effect on the synchronousEmbeddingStoreContentRetriever.retrieve(Query).- Since:
- 1.20.0
-
build
-