Class DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder
java.lang.Object
dev.langchain4j.rag.DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder
- Enclosing class:
DefaultRetrievalAugmentor
-
Method Summary
Modifier and TypeMethodDescriptionbuild()contentAggregator(ContentAggregator contentAggregator) contentInjector(ContentInjector contentInjector) contentRetriever(ContentRetriever contentRetriever) offloadBlocking(boolean offloadBlocking) Controls whatDefaultRetrievalAugmentor.augmentAsync(AugmentationRequest)does when a pipeline stage (query transformation, routing, retrieval or aggregation) is not genuinely asynchronous (its*Asyncmethod is not implemented).queryRouter(QueryRouter queryRouter) queryTransformer(QueryTransformer queryTransformer)
-
Method Details
-
contentRetriever
public DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder contentRetriever(ContentRetriever contentRetriever) -
queryTransformer
public DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder queryTransformer(QueryTransformer queryTransformer) -
queryRouter
public DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder queryRouter(QueryRouter queryRouter) -
contentAggregator
public DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder contentAggregator(ContentAggregator contentAggregator) -
contentInjector
public DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder contentInjector(ContentInjector contentInjector) -
executor
-
offloadBlocking
@Experimental public DefaultRetrievalAugmentor.DefaultRetrievalAugmentorBuilder offloadBlocking(boolean offloadBlocking) Controls whatDefaultRetrievalAugmentor.augmentAsync(AugmentationRequest)does when a pipeline stage (query transformation, routing, retrieval or aggregation) is not genuinely asynchronous (its*Asyncmethod is not implemented).By default (
false),augmentAsyncfails with an actionable error naming the blocking stage, so a not-truly-async pipeline is never silently made "async" by parking a thread. Set totrueto instead offload the blocking stage to the shared default executor (virtual threads on Java 21+, platform threads on 17-20) (theExecutorProviderdefault) - not the synchronous fan-outexecutor. Has no effect on the synchronousDefaultRetrievalAugmentor.augment(AugmentationRequest).- Since:
- 1.20.0
-
build
-