mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-10 03:45:17 +03:00
This patch updates function "run" to "invoke". Without this patch you see following warning. LangChainDeprecationWarning: The function `run` was deprecated in LangChain 0.1.0 and will be removed in 0.2.0. Use invoke instead. Signed-off-by: Masanari Iida <standby24x7@gmail.com>
1.9 KiB
1.9 KiB
In [4]:
from langchain.chains import LLMMathChain
from langchain_openai import OpenAI
llm = OpenAI(temperature=0)
llm_math = LLMMathChain.from_llm(llm, verbose=True)
llm_math.invoke("What is 13 raised to the .3432 power?")Out [4]:
[1m> Entering new LLMMathChain chain...[0m
What is 13 raised to the .3432 power?[32;1m[1;3m
```text
13 ** .3432
```
...numexpr.evaluate("13 ** .3432")...
[0m
Answer: [33;1m[1;3m2.4116004626599237[0m
[1m> Finished chain.[0m
'Answer: 2.4116004626599237'
In [ ]: