java.lang.Object
com.hw.langchain.llms.base.BaseLLM
com.hw.langchain.chat.models.base.LLM
All Implemented Interfaces:
BaseLanguageModel
Direct Known Subclasses:
ChatGLM

public abstract class LLM extends BaseLLM
Base LLM abstract class. The purpose of this class is to expose a simpler interface for working with LLMs, rather than expect the user to implement the full innerGenerate method.
Author:
HamaWhite
  • Constructor Details

    • LLM

      public LLM()
  • Method Details

    • innerCall

      public abstract String innerCall(String prompt, List<String> stop)
      Run the LLM on the given prompt and input.
      Parameters:
      prompt - The prompt to pass into the model.
      stop - list of stop words to use when generating.
      Returns:
      The string generated by the model.
    • innerGenerate

      protected LLMResult innerGenerate(List<String> prompts, List<String> stop)
      Description copied from class: BaseLLM
      Run the LLM on the given prompts.
      Specified by:
      innerGenerate in class BaseLLM
    • asyncInnerGenerate

      protected reactor.core.publisher.Flux<AsyncLLMResult> asyncInnerGenerate(List<String> prompts, List<String> stop)
      Description copied from class: BaseLLM
      Run the LLM on the given prompts async.
      Specified by:
      asyncInnerGenerate in class BaseLLM