Package dev.langchain4j.rag
Interface RetrievalAugmentor
- All Known Implementing Classes:
DefaultRetrievalAugmentor
public interface RetrievalAugmentor
Augments the provided
This serves as an entry point into the RAG flow in LangChain4j.
You are free to use the default implementation (
ChatMessage with retrieved Contents.
This serves as an entry point into the RAG flow in LangChain4j.
You are free to use the default implementation (
DefaultRetrievalAugmentor) or to implement a custom one.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaugment(UserMessage userMessage, Metadata metadata) Deprecated.default AugmentationResultaugment(AugmentationRequest augmentationRequest)
-
Method Details
-
augment
Augments theChatMessageprovided in theAugmentationRequestwith retrievedContents.
This method has a default implementation in order to temporarily support current custom implementations ofRetrievalAugmentor. The default implementation will be removed soon.- Parameters:
augmentationRequest- TheAugmentationRequestcontaining theChatMessageto augment.- Returns:
- The
AugmentationResultcontaining the augmentedChatMessage.
-
augment
Deprecated.Use/implementaugment(AugmentationRequest)instead.Augments the providedUserMessagewith retrieved content.- Parameters:
userMessage- TheUserMessageto be augmented.metadata- TheMetadatathat may be useful or necessary for retrieval and augmentation.- Returns:
- The augmented
UserMessage.
-
augment(AugmentationRequest)instead.