diff --git a/docs/docs/integrations/llms/llamacpp.ipynb b/docs/docs/integrations/llms/llamacpp.ipynb index 9868fab6ae9..5b03e5f4a25 100644 --- a/docs/docs/integrations/llms/llamacpp.ipynb +++ b/docs/docs/integrations/llms/llamacpp.ipynb @@ -208,11 +208,9 @@ }, "outputs": [], "source": [ - "from langchain.callbacks.manager import CallbackManager\n", - "from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler\n", - "from langchain.chains import LLMChain\n", - "from langchain.prompts import PromptTemplate\n", - "from langchain_community.llms import LlamaCpp" + "from langchain_community.llms import LlamaCpp\n", + "from langchain_core.callbacks import CallbackManager, StreamingStdOutCallbackHandler\n", + "from langchain_core.prompts import PromptTemplate" ] }, { @@ -329,10 +327,10 @@ } ], "source": [ - "prompt = \"\"\"\n", + "question = \"\"\"\n", "Question: A rap battle between Stephen Colbert and John Oliver\n", "\"\"\"\n", - "llm.invoke(prompt)" + "llm.invoke(question)" ] }, { @@ -360,7 +358,7 @@ "metadata": {}, "outputs": [], "source": [ - "llm_chain = LLMChain(prompt=prompt, llm=llm)" + "llm_chain = prompt | llm" ] }, { @@ -406,7 +404,7 @@ ], "source": [ "question = \"What NFL team won the Super Bowl in the year Justin Bieber was born?\"\n", - "llm_chain.run(question)" + "llm_chain.invoke({\"question\": question})" ] }, { @@ -488,9 +486,9 @@ } ], "source": [ - "llm_chain = LLMChain(prompt=prompt, llm=llm)\n", + "llm_chain = prompt | llm\n", "question = \"What NFL team won the Super Bowl in the year Justin Bieber was born?\"\n", - "llm_chain.run(question)" + "llm_chain.invoke({\"question\": question})" ] }, { @@ -710,7 +708,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.6" + "version": "3.9.1" }, "vscode": { "interpreter": {