Class BaseUtils
java.lang.Object
com.hw.langchain.chains.query.constructor.base.BaseUtils
- Author:
- HamaWhite
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatAttributeInfo
(List<AttributeInfo> infos) static LLMChain
loadQueryConstructorChain
(BaseLanguageModel llm, String documentContents, List<AttributeInfo> attributeInfo, List<Map<String, Object>> examples, List<Comparator> allowedComparators, List<Operator> allowedOperators, boolean enableLimit) Load a query constructor chain.
-
Method Details
-
formatAttributeInfo
-
loadQueryConstructorChain
public static LLMChain loadQueryConstructorChain(BaseLanguageModel llm, String documentContents, List<AttributeInfo> attributeInfo, List<Map<String, Object>> examples, List<Comparator> allowedComparators, List<Operator> allowedOperators, boolean enableLimit) Load a query constructor chain.- Parameters:
llm
- BaseLanguageModel to use for the chain.documentContents
- The contents of the document to be queried.attributeInfo
- A list of AttributeInfo objects describing the attributes of the document.examples
- Optional list of examples to use for the chain.allowedComparators
- A list of allowed comparators.allowedOperators
- A list of allowed operators.enableLimit
- Whether to enable the limit operator. Defaults to False.- Returns:
- A LLMChain that can be used to construct queries.
-