Package dev.langchain4j.chain
Class ConversationalRetrievalChain
java.lang.Object
dev.langchain4j.chain.ConversationalRetrievalChain
A chain for conversing with a specified
Chains are not going to be developed further, it is recommended to use
ChatLanguageModel
based on the information retrieved by a specified ContentRetriever
.
Includes a default ChatMemory
(a message window with maximum 10 messages), which can be overridden.
You can fully customize RAG behavior by providing an instance of a RetrievalAugmentor
,
such as DefaultRetrievalAugmentor
, or your own custom implementation.
Chains are not going to be developed further, it is recommended to use
AiServices
instead.-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionConversationalRetrievalChain
(ChatLanguageModel chatLanguageModel, ChatMemory chatMemory, PromptTemplate promptTemplate, Retriever<TextSegment> retriever) Deprecated, for removal: This API element is subject to removal in a future version.ConversationalRetrievalChain
(ChatLanguageModel chatLanguageModel, ChatMemory chatMemory, ContentRetriever contentRetriever) ConversationalRetrievalChain
(ChatLanguageModel chatLanguageModel, ChatMemory chatMemory, RetrievalAugmentor retrievalAugmentor) -
Method Summary
-
Constructor Details
-
ConversationalRetrievalChain
public ConversationalRetrievalChain(ChatLanguageModel chatLanguageModel, ChatMemory chatMemory, ContentRetriever contentRetriever) -
ConversationalRetrievalChain
public ConversationalRetrievalChain(ChatLanguageModel chatLanguageModel, ChatMemory chatMemory, RetrievalAugmentor retrievalAugmentor) -
ConversationalRetrievalChain
@Deprecated(forRemoval=true) public ConversationalRetrievalChain(ChatLanguageModel chatLanguageModel, ChatMemory chatMemory, PromptTemplate promptTemplate, Retriever<TextSegment> retriever) Deprecated, for removal: This API element is subject to removal in a future version.Please use another constructor with a newContentRetriever
instead.
-
-
Method Details
ContentRetriever
instead.