Class ConversationalChain

java.lang.Object
dev.langchain4j.chain.ConversationalChain
All Implemented Interfaces:
dev.langchain4j.chain.Chain<String,String>

public class ConversationalChain extends Object implements dev.langchain4j.chain.Chain<String,String>
A chain for conversing with a specified ChatLanguageModel while maintaining a memory of the conversation. Includes a default ChatMemory (a message window with maximum 10 messages), which can be overridden.
It is recommended to use AiServices instead, as it is more powerful.
  • Method Details

    • execute

      public String execute(String userMessage)
      Specified by:
      execute in interface dev.langchain4j.chain.Chain<String,String>