Skip to content

The agent engineering platform.

docs: Update local llms article to use invoke instead of deprecated __call__ (#19528)

Erica Clarka1ff21f90fd2
diff --git a/docs/docs/guides/local_llms.ipynb b/docs/docs/guides/local_llms.ipynb
index 9c1cd9f127..23253640b0 100644
--- a/docs/docs/guides/local_llms.ipynb
+++ b/docs/docs/guides/local_llms.ipynb
@@ -98,7 +98,7 @@
"from langchain_community.llms import Ollama\n",
"\n",
"llm = Ollama(model=\"llama2\")\n",
- "llm(\"The first man on the moon was ...\")"
+ "llm.invoke(\"The first man on the moon was ...\")"
]
},
{
@@ -140,7 +140,7 @@
"llm = Ollama(\n",
" model=\"llama2\", callback_manager=CallbackManager([StreamingStdOutCallbackHandler()])\n",
")\n",
- "llm(\"The first man on the moon was ...\")"
+ "llm.invoke(\"The first man on the moon was ...\")"
]
},
{
@@ -226,7 +226,7 @@
"from langchain_community.llms import Ollama\n",
"\n",
"llm = Ollama(model=\"llama2:13b\")\n",
- "llm(\"The first man on the moon was ... think step by step\")"
+ "llm.invoke(\"The first man on the moon was ... think step by step\")"
]
},
{
@@ -369,7 +369,7 @@
}
],
"source": [
- "llm(\"The first man on the moon was ... Let's think step by step\")"
+ "llm.invoke(\"The first man on the moon was ... Let's think step by step\")"
]
},
{
@@ -426,7 +426,7 @@
}
],
"source": [
- "llm(\"The first man on the moon was ... Let's think step by step\")"
+ "llm.invoke(\"The first man on the moon was ... Let's think step by step\")"
]
},
{