Class BaseCombineDocumentsChain
java.lang.Object
com.hw.langchain.chains.base.Chain
com.hw.langchain.chains.combine.documents.base.BaseCombineDocumentsChain
- Direct Known Subclasses:
StuffDocumentsChain
Base interface for chains combining documents.
- Author:
- HamaWhite
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract reactor.core.publisher.Flux<org.apache.commons.lang3.tuple.Pair<String,
Map<String, String>>> Combine documents into a single string async.asyncInnerCall
(Map<String, Object> inputs) Runs the logic of this chain and returns the async output.Combine documents into a single string.Runs the logic of this chain and returns the output.Retrieves the list of input keys that this chain expects.Retrieves the list of output keys that this chain expects.Return the prompt length given the documents passed in.
-
Field Details
-
inputKey
-
outputKey
-
-
Constructor Details
-
BaseCombineDocumentsChain
public BaseCombineDocumentsChain()
-
-
Method Details
-
inputKeys
Description copied from class:Chain
Retrieves the list of input keys that this chain expects. -
outputKeys
Description copied from class:Chain
Retrieves the list of output keys that this chain expects.- Specified by:
outputKeys
in classChain
- Returns:
- the list of output keys
-
promptLength
Return the prompt length given the documents passed in. Returns None if the method does not depend on the prompt length. -
combineDocs
public abstract org.apache.commons.lang3.tuple.Pair<String,Map<String, combineDocsString>> (List<Document> docs, Map<String, Object> kwargs) Combine documents into a single string. -
asyncCombineDocs
public abstract reactor.core.publisher.Flux<org.apache.commons.lang3.tuple.Pair<String,Map<String, asyncCombineDocsString>>> (List<Document> docs, Map<String, Object> kwargs) Combine documents into a single string async. -
innerCall
Description copied from class:Chain
Runs the logic of this chain and returns the output. -
asyncInnerCall
Description copied from class:Chain
Runs the logic of this chain and returns the async output.- Overrides:
asyncInnerCall
in classChain
- Parameters:
inputs
- the inputs to be processed by the chain- Returns:
- a map flux containing the output generated event by the chain
-