Skip to content

The agent engineering platform.

docs: Fix classification notebook small mistake (#32636)

chen-assertd72da29c0b60
diff --git a/docs/docs/tutorials/classification.ipynb b/docs/docs/tutorials/classification.ipynb
index c0540718d4..b142673125 100644
--- a/docs/docs/tutorials/classification.ipynb
+++ b/docs/docs/tutorials/classification.ipynb
@@ -95,7 +95,6 @@
"outputs": [],
"source": [
"from langchain_core.prompts import ChatPromptTemplate\n",
- "from langchain_openai import ChatOpenAI\n",
"from pydantic import BaseModel, Field\n",
"\n",
"tagging_prompt = ChatPromptTemplate.from_template(\n",
@@ -253,9 +252,7 @@
"\"\"\"\n",
")\n",
"\n",
- "llm = ChatOpenAI(temperature=0, model=\"gpt-4o-mini\").with_structured_output(\n",
- " Classification\n",
- ")"
+ "structured_llm = llm.with_structured_output(Classification)"
]
},
{
@@ -286,7 +283,7 @@
"source": [
"inp = \"Estoy increiblemente contento de haberte conocido! Creo que seremos muy buenos amigos!\"\n",
"prompt = tagging_prompt.invoke({\"input\": inp})\n",
- "llm.invoke(prompt)"
+ "structured_llm.invoke(prompt)"
]
},
{
@@ -309,7 +306,7 @@
"source": [
"inp = \"Estoy muy enojado con vos! Te voy a dar tu merecido!\"\n",
"prompt = tagging_prompt.invoke({\"input\": inp})\n",
- "llm.invoke(prompt)"
+ "structured_llm.invoke(prompt)"
]
},
{
@@ -332,7 +329,7 @@
"source": [
"inp = \"Weather is ok here, I can go outside without much more than a coat\"\n",
"prompt = tagging_prompt.invoke({\"input\": inp})\n",
- "llm.invoke(prompt)"
+ "structured_llm.invoke(prompt)"
]
},
{