Class LLMMathChain
java.lang.Object
com.hw.langchain.chains.base.Chain
com.hw.langchain.chains.llm.math.base.LLMMathChain
Chain that interprets a prompt and executes python code to do math.
- Author:
- HamaWhite
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionevaluateExpression
(String expression) static LLMMathChain
fromLLM
(BaseLanguageModel llm) static LLMMathChain
fromLLM
(BaseLanguageModel llm, BasePromptTemplate prompt) Runs the logic of this chain and returns the output.Expect input key.Expect output key.processLLMResult
(String llmOutput)
-
Constructor Details
-
LLMMathChain
public LLMMathChain() -
LLMMathChain
-
-
Method Details
-
fromLLM
-
fromLLM
-
chainType
-
inputKeys
Expect input key. -
outputKeys
Expect output key.- Specified by:
outputKeys
in classChain
- Returns:
- the list of output keys
-
evaluateExpression
-
processLLMResult
-
innerCall
Description copied from class:Chain
Runs the logic of this chain and returns the output.
-