mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-06 09:55:21 +03:00
Co-authored-by: Nuno Campos <nuno@boringbits.io> Co-authored-by: Davis Chase <130488702+dev2049@users.noreply.github.com> Co-authored-by: Zander Chase <130414180+vowelparrot@users.noreply.github.com> Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
1.8 KiB
1.8 KiB
In [4]:
from langchain import OpenAI, LLMMathChain
llm = OpenAI(temperature=0)
llm_math = LLMMathChain.from_llm(llm, verbose=True)
llm_math.run("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 [ ]: