Class BaseRetrievalQA

java.lang.Object
com.hw.langchain.chains.base.Chain
com.hw.langchain.chains.retrieval.qa.base.BaseRetrievalQA
Direct Known Subclasses:
RetrievalQa

public abstract class BaseRetrievalQA extends Chain
Author:
HamaWhite
  • Constructor Details

  • Method Details

    • inputKeys

      public List<String> inputKeys()
      Description copied from class: Chain
      Retrieves the list of input keys that this chain expects.
      Specified by:
      inputKeys in class Chain
      Returns:
      the list of input keys
    • outputKeys

      public List<String> outputKeys()
      Description copied from class: Chain
      Retrieves the list of output keys that this chain expects.
      Specified by:
      outputKeys in class Chain
      Returns:
      the list of output keys
    • getDocs

      public abstract List<Document> getDocs(String question)
      Get documents to do question answering over.
    • innerCall

      protected Map<String,String> innerCall(Map<String,Object> inputs)
      Run getRelevantText and llm on input query.
      Specified by:
      innerCall in class Chain
      Parameters:
      inputs - the inputs to be processed by the chain
      Returns:
      a map containing the output generated by the chain
    • asyncInnerCall

      protected reactor.core.publisher.Flux<Map<String,String>> asyncInnerCall(Map<String,Object> inputs)
      Description copied from class: Chain
      Runs the logic of this chain and returns the async output.
      Overrides:
      asyncInnerCall in class Chain
      Parameters:
      inputs - the inputs to be processed by the chain
      Returns:
      a map flux containing the output generated event by the chain