Class MapAnswerWithSourcesChain
java.lang.Object
com.github.hakenadu.javalangchains.chains.qa.MapAnswerWithSourcesChain
- All Implemented Interfaces:
Chain<String,AnswerWithSources>
public class MapAnswerWithSourcesChain extends Object implements Chain<String,AnswerWithSources>
Splits answers with sources from a QA chain.
Examples
I don't know who James Anderson is. SOURCES:
There are two different John Does mentioned, one is a scientist and humanitarian, and the other is a traveler and author of a travel memoir. It is not clear if they are the same person or two different people with the same name. SOURCES: 1, 3
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MapAnswerWithSourcesChain()creates an instance ofMapAnswerWithSourcesChainwith a default regex to retrieve sourcesMapAnswerWithSourcesChain(String retrieveSourcesRegex)MapAnswerWithSourcesChain(Pattern retrieveSourcesPattern) -
Method Summary
Modifier and Type Method Description AnswerWithSourcesrun(String input)Execute thisChain
-
Constructor Details
-
MapAnswerWithSourcesChain
- Parameters:
retrieveSourcesPattern-retrieveSourcesPattern
-
MapAnswerWithSourcesChain
- Parameters:
retrieveSourcesRegex- used to create theretrieveSourcesPattern
-
MapAnswerWithSourcesChain
public MapAnswerWithSourcesChain()creates an instance ofMapAnswerWithSourcesChainwith a default regex to retrieve sources
-
-
Method Details