{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/tutu/anaconda3/lib/python3.10/site-packages/langchain/chains/llm_math/base.py:50: UserWarning: Directly instantiating an LLMMathChain with an llm is deprecated. Please instantiate with llm_chain argument or using the from_llm class method.\n", " warnings.warn(\n" ] } ], "source": [ "from langchain.chains import load_chain\n", "\n", "chain = load_chain(\"lc://chains/llm-math/chain.json\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "\u001b[1m> Entering new LLMMathChain chain...\u001b[0m\n", "whats 2 raised to .12\u001b[32;1m\u001b[1;3m\n", "Answer: 1.0791812460476249\u001b[0m\n", "\u001b[1m> Finished chain.\u001b[0m\n" ] }, { "data": { "text/plain": [ "'Answer: 1.0791812460476249'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "chain.run(\"whats 2 raised to .12\")" ] } ], "metadata": { "kernelspec": { "display_name": "base", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.10" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }