Package dev.langchain4j.rag
Interface RetrievalAugmentor
-
- All Implemented Interfaces:
public interface RetrievalAugmentorAugments the provided 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.
-
-
Method Summary
Modifier and Type Method Description AugmentationResultaugment(AugmentationRequest augmentationRequest)Augments the ChatMessage provided in the AugmentationRequest with retrieved Contents. abstract UserMessageaugment(UserMessage userMessage, Metadata metadata)Augments the provided UserMessage with retrieved content. -
-
Method Detail
-
augment
AugmentationResult augment(AugmentationRequest augmentationRequest)
Augments the ChatMessage provided in the AugmentationRequest with retrieved Contents. This method has a default implementation in order to temporarily support current custom implementations of
RetrievalAugmentor. The default implementation will be removed soon.- Parameters:
augmentationRequest- TheAugmentationRequestcontaining theChatMessageto augment.- Returns:
The AugmentationResult containing the augmented
ChatMessage.
-
augment
@Deprecated() abstract UserMessage augment(UserMessage userMessage, Metadata metadata)
Augments the provided UserMessage with retrieved content.
- Parameters:
userMessage- The UserMessage to be augmented.metadata- The Metadata that may be useful or necessary for retrieval and augmentation.- Returns:
The augmented UserMessage.
-
-
-
-