When running in 07_Agents/00_Function_DIY_Agents.ipynb notebook
from langchain import LLMMathChain
math_tool_template = """\
Given a question from the Human with a math problem, provide only a single line mathematical expression that solves the problem in the following format.
Never solve the expression only create a parsable expression.
```text
${{single line mathematical expression that solves the problem}}
```
Here is an example response with a single line mathematical expression for solving a math problem:
```text
37593**(1/5)
```
Human: {question}
Assistant:"""
llm_math_chain = LLMMathChain.from_llm(llm=agent_llm, verbose=True)
llm_math_chain.llm_chain.prompt.template = math_tool_template
result = llm_math_chain('What is nine times 465?')
getting following error:
ImportError: LLMMathChain requires the numexpr package. Please install it with `pip install numexpr`.
When running in 07_Agents/00_Function_DIY_Agents.ipynb notebook
getting following error:
Solution that works for me: