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 Content
s.
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 AugmentationResult
augment
(AugmentationRequest augmentationRequest)
-
Method Details
-
augment
Augments theChatMessage
provided in theAugmentationRequest
with retrievedContent
s.
This method has a default implementation in order to temporarily support current custom implementations ofRetrievalAugmentor
. The default implementation will be removed soon.- Parameters:
augmentationRequest
- TheAugmentationRequest
containing theChatMessage
to augment.- Returns:
- The
AugmentationResult
containing the augmentedChatMessage
.
-
augment
Deprecated.Use/implementaugment(AugmentationRequest)
instead.Augments the providedUserMessage
with retrieved content.- Parameters:
userMessage
- TheUserMessage
to be augmented.metadata
- TheMetadata
that may be useful or necessary for retrieval and augmentation.- Returns:
- The augmented
UserMessage
.
-
augment(AugmentationRequest)
instead.