Class ConversationalChain

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

public class ConversationalChain extends Object implements 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.
Chains are not going to be developed further, it is recommended to use AiServices instead.
  • Method Details

    • execute

      public String execute(String userMessage)
      Description copied from interface: Chain
      Execute the chain step.
      Specified by:
      execute in interface Chain<String,String>
      Parameters:
      userMessage - the input
      Returns:
      the output