diff --git a/docs/cassettes/llm_chain_1b2481f0.msgpack.zlib b/docs/cassettes/llm_chain_1b2481f0.msgpack.zlib
index d8941b0e1a6d8..854400a94ec8a 100644
--- a/docs/cassettes/llm_chain_1b2481f0.msgpack.zlib
+++ b/docs/cassettes/llm_chain_1b2481f0.msgpack.zlib
@@ -1 +1 @@
-eNqdVWtsFFUULrb4TvxjpPERx0aDms7szL63a4Nlu7SFttvultKl0XX2zt3daWfmTufe2e4WQUTkD4KODzQhosh2V2opkOIDFIwxRGLUaDRqMT4SH2DUKLHGIAre2W6lDfxyk93ZO+ec755zvu/cu6GUhQaWkbZgXNYINERA6AJbG0oGHDIhJhuLKiQZJBW6IrGeXaYhT92ZIUTHDQ6HqMsc0qEmyhxAqiMrOEBGJA76X1dgGaaQRFJ+6uiaOhViLKYhrmtg+tfUAUS30ghd1PUYooYVkUCGZCCTQoqChmUtzaQMpDJhLa3IOMPQzBDTRkRFFrW6eqbOQAq0g3EeE6jWra1n5mFm5FvmepkYGnVr76FvVCRBxX6V1gnrtn00uhLoExMDiipdpEQFQ/qC4uq0G8Q0bAye860tZaAo0V49WsggTKyJ+dXvFQGAFBVqAEm0AGtPekTW6xkJpuzqxmh6Giz31hobhFBnaTFZWJyJsvaJuq7IQLTtjgGMtPFKOSzJ6/BC85hdE0sbqhHrQIQm0dTm6MpTmjRG4Nx+jt+XYzERZU2hfWcVkeZT1Mv21+cadBEMUhC2IgGrOBM8MdcHYWu0QwSR2DxI0QAZa1Q0VK97cu57w9SIrEKrFOq6cLuK8fx2Lk4QON/+ecA4rwFrtEzDq/OCITHyLEAUw9rJT8z2R4FammSsXULA96IBsU5FBx8q0jBi4g0FygV871ipor4XIitmSfyq6rpCM+XFOrzMkOsZp4+JQZ1x8k43I3gaPIEGt4dp6egZD1W26bkoDfvL6k1RKsKztJdAxtQGoTQWuijhh23CaTV2+lSfLMzpCEO2kpU13sdGZ8aObWuenFEXi4y0qMkj5W2tw2Xmh0dywxIwJSmTHVb5wIjbJSehC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/HZzuBFLTxI/OHVhoHbw6dmmVMfL4iQVRjBTu2YS6Rv8WSww2vT47/823w1+YmboWPbM5r11gDxwePfwe/X3m3Jrig8+8/9ZefXbz+kO/DRJvrn0itP7Th26c//i5/0yfvPDvn3wQfCnwtS+6fF/d+6/q7jOedf/c8FnuWvGdB2nrkfkXXlk3Gj8++/LnfVTn4Ubhqa7KS+LU/unGhoYbN1Y3rFv1/HMfrmpo+C/xZpFc
\ No newline at end of file
diff --git a/docs/cassettes/llm_chain_3e45595a.msgpack.zlib b/docs/cassettes/llm_chain_3e45595a.msgpack.zlib
index df51bda179f41..481dc32e51e9c 100644
--- a/docs/cassettes/llm_chain_3e45595a.msgpack.zlib
+++ b/docs/cassettes/llm_chain_3e45595a.msgpack.zlib
@@ -1 +1 @@
-eNptVQ1sE2UY3iCKI/GHIEQiQlkkKtnd7vp37caQrRvb2Fi3dowV0Hq9+9rednffcd93WzsCxkFUQiRcECIhUXFda+bcRkD+BBOVP6NkigacGogGIYZEwWggRsDvuk62jEv6833v+z7v3/O+153pADqSoJrfL6kY6LyAyQGZ3RkdrDMAwpvTCsBxKKYa/cHmHkOXRhbFMdZQSXExr0k01IDKS7QAleIOtliI87iY/NdkkIVJRaCYHDm8vlABCPExgApLbGvWFwqQuFIxORQ267yKZB4DG44DWxTKMuyU1JiNBANtEuZliVdLCotshTqUgWWAkggDpXBDkW0CTlwar2QgoBdueIHcKFAEsnUV0zDltHRUcmLJL8I64BVyiPIyAuSCwGqkANjQLQyG5jZk4oAXSXku5j2WikOEzYGJKQ/yggAILlAFKJKozQ9jXZJWZBNB1Eqpj8SngmxBzb52ADSKpNMB0qNW5hCvabIk8Ja8uA1BtT+XD4WTGpgs7rOyokgVVWwe8JMgymuLG5OkN6qNpZ0emhlKUAjzkiqTYlMyT+JJa1n5x+MFGi+0ExAq13czPWo8MF4HIrN3BS/4gxMgeV2Im728rrid+8ff64aKJQWYGV/jZHc54T13DpplaW7fBGCUVAWzN9uIQxOMAdaTlAAJhr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1HHncMlEx5x/19ma1+sLPEe2E2VX593e7Vpz5Vz7zF2FJ1cw5yo8p9799eSs8xcHz+etaK/zPXJpWu720qub9/gXtrVOnpgcCugzPLudF5rq3D+vvvXWH2c2BOvaB5uW5T2z1X46+Qao3Ta4/b14/IlvZ6KO9m1nx9XXPdq+elntnej7v/SHDq7vvse+Mu47b9GcSWLHtLufDh2IfHkvvGrP5tk3JlS39eVd3PF4d27nZvfKq6/OmDkvt37L+M6v6L9zc3Lu3ZuQ82N9ue/G+Jyc/wBrj1IS
\ No newline at end of file
diff --git a/docs/cassettes/llm_chain_3e82f933.msgpack.zlib b/docs/cassettes/llm_chain_3e82f933.msgpack.zlib
deleted file mode 100644
index f2968c0213a7b..0000000000000
--- a/docs/cassettes/llm_chain_3e82f933.msgpack.zlib
+++ /dev/null
@@ -1 +0,0 @@
-eNptVWtsFFUULpSgEh8VRGOMYboaf5jOdGZfs1Mkpt2Wtva9Wyqr0XX2zt3daWfmTufeaXdbqxEJCVHUkYjvH6XLLja18mgEQYxRVDQIGo2mKBpf8YGvoMSoIXhnu5U2ZZJ93HvO+c7rO2c2FAaghVVkLJpQDQItGRB6wM6GggX7bYjJxrwOSRopuc6OaPeYbanTN6cJMXFNdbVsqhwyoSGrHEB69YBQDdIyqab/TQ0WYXIJpGSn3xr26BBjOQWxp4a5c9gDEHVlEHrwdFuygTWZQIakIZNEmoYGVSPFJC2kMw1GSlNxmqGRIaaZyJoqG54qxmMhDbrGOIsJ1D0jVcw8zLRaOVfLxtDyjNxFb3SkQM29SpmE9bs6Bj0J9BcTC8o6PSRlDUN6QXFNWg1iWy4Gz4kjhTSUFVqrL8oqcmmEiTM5P/+XZAAgxYUGQApNwXkxNaSaVYwCk25+4zRAAxar64z3QWiyNJ0BmJ+xcnbJpqmpQHbl1b0YGROlhFiSNeFC8bibFUtLahBnqoMGUdtc3ZmljTIYgfOHOH5XhsVEVg2NVp7VZBpP3izKD84VmDLooyBsiQROfsZ4cq4Ows6ONhl0ROdByhZ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54+u/tjdPzLv/jNl5+4d/TrsVORrm8u3XPT8OvvjSkPv/AHfTtMXv3jmQPll61Mb3/RuuWuttSpv/cMfpxbufTI4UbPxoqDv153cHrx/cyKve92qfySWKXy5g2Vr2/dvOxIBblHvfamG7qVa38ZndxG+t+7ZZv+2O6t+pYfz5z93Rd+4o+pS9as+jNy5/U/fT52qQLMe6wPPhzxHE4Ndg9/suK5wtv9x6Yariu/5mwbf0x8Ax5/av0zK46fvrXjbqZFf+NdztxZ0ANLj2565KRTcV852PrkiZ4fnv/0ZOvJq/799gq3UuVly2L7Oq5fXFb2H5UFMyI=
\ No newline at end of file
diff --git a/docs/cassettes/llm_chain_6bacb837.msgpack.zlib b/docs/cassettes/llm_chain_6bacb837.msgpack.zlib
deleted file mode 100644
index a8acc9ea3bb70..0000000000000
--- a/docs/cassettes/llm_chain_6bacb837.msgpack.zlib
+++ /dev/null
@@ -1 +0,0 @@
-eNptVWtsFFUULi/TABoSrYlBZNhIgqYzndnZ3dktElK2hdbSd6ksKMvszN3d6c7Mnc69s91tg0aeKkaZf4gBHyy7ZikFpEFEihKor6AQHz8agpqgJCoYwRJAMXhnu5U2MMk+7j3nfOf1nTPrc0lgIgXqk/oUHQNTlDA5IHt9zgRdFkB4Y1YDOA7lTHNTW/tuy1SGn4xjbKDKigrRUBhoAF1UGAlqFUmuQoqLuIL8N1RQgMlEoJweHup1aQAhMQaQq5Ja3euSIHGlY3JwtZuijlQRAwrHARWFqgq7FT1GRU2oUTV6TFVQnCKRQaoOi6oi6q5yymVCFTjGKI0w0FzryqkJmHFl3ngtCwHTte45cqNBGajOVczAtMfR0cmJI78Im0DUyCEqqgiQC4JrkGpgy3QwWEZYl4sDUSa1+qFkViYOEbb7J+a/X5QkQHCBLkGZpGDvi/UoRjklg6iTX54EqINCde18AgCDJukkQXbUyj4gGoaqSKIjr+hEUO8rJkTjtAHuFuedrGhSUh3bA00kiKq6iuY0aZROcYzHz7AHUjTCoqKrpPK0KpJ4skZB/tF4gSFKC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Hxi//0Xrt69qlroS9/5Y/uDF1e+/CjI1defuVMf6JGi23zDj/Y8cB8qbbhr/LwvkO3knOq6st2rE1U7tp/ceubOOA/nCnrWXBqtWvjrC037j+vbupdcCqS7Fg1ssZXOnSjttSQ10/+pvdyaNXm4alloaWzf9cHMnvrLx74Y3DmThWefnvuZ2890lm5bO7zP+1ek9j772G8YNHwrEtvVL40sr30ymOv/3Z7ZOPXLee6vhjZ5JsaPdnAfiWc+OWT7St3zDhzdXFTaF69dmuIMfI5jZ9W/ulrV2r/XLzrIJ3QZuOd33Zl/UPczWlOpaaUnJj+6mtzJpeU/AdOizBy
\ No newline at end of file
diff --git a/docs/docs/tutorials/index.mdx b/docs/docs/tutorials/index.mdx
index e524695dbaed7..7cf4af7e2db56 100644
--- a/docs/docs/tutorials/index.mdx
+++ b/docs/docs/tutorials/index.mdx
@@ -6,7 +6,7 @@ sidebar_class_name: hidden
New to LangChain or LLM app development in general? Read this material to quickly get up and running building your first applications.
-If you're looking to get up and running quickly with [chat models](/docs/integrations/chat/), [vector stores](/docs/integrations/vectorstores/),
+If you're looking to get started with [chat models](/docs/integrations/chat/), [vector stores](/docs/integrations/vectorstores/),
or other LangChain components from a specific provider, check out our supported [integrations](/docs/integrations/providers/).
Refer to the [how-to guides](/docs/how_to) for more detail on using common LangChain components.
@@ -14,7 +14,7 @@ Refer to the [how-to guides](/docs/how_to) for more detail on using common LangC
See the [conceptual documentation](/docs/concepts) for high level explanations of all LangChain concepts.
## Basics
-- [LLM applications](/docs/tutorials/llm_chain): Build and deploy a simple LLM application.
+- [LLM applications](/docs/tutorials/llm_chain): Build a simple LLM application with prompt templates and chat models.
- [Chatbots](/docs/tutorials/chatbot): Build a chatbot that incorporates memory.
- [Vector stores](/docs/tutorials/retrievers): Build vector stores and use them to retrieve data.
- [Agents](/docs/tutorials/agents): Build an agent that interacts with external tools.
diff --git a/docs/docs/tutorials/llm_chain.ipynb b/docs/docs/tutorials/llm_chain.ipynb
index db837dad56b97..fccc2c6cd9fc1 100644
--- a/docs/docs/tutorials/llm_chain.ipynb
+++ b/docs/docs/tutorials/llm_chain.ipynb
@@ -15,7 +15,7 @@
"id": "9316da0d",
"metadata": {},
"source": [
- "# Build a Simple LLM Application with LCEL\n",
+ "# Build a Simple LLM Application\n",
"\n",
"In this quickstart we'll show you how to build a simple LLM application with LangChain. This application will translate text from English into another language. This is a relatively simple LLM application - it's just a single LLM call plus some prompting. Still, this is a great way to get started with LangChain - a lot of features can be built with just some prompting and an LLM call!\n",
"\n",
@@ -23,23 +23,17 @@
"\n",
"- Using [language models](/docs/concepts/chat_models)\n",
"\n",
- "- Using [PromptTemplates](/docs/concepts/prompt_templates) and [OutputParsers](/docs/concepts/output_parsers)\n",
- "\n",
- "- Using [LangChain Expression Language (LCEL)](/docs/concepts/lcel) to chain components together\n",
+ "- Using [PromptTemplates](/docs/concepts/prompt_templates)\n",
"\n",
"- Debugging and tracing your application using [LangSmith](https://docs.smith.langchain.com/)\n",
"\n",
- "- Deploying your application with [LangServe](/docs/concepts/architecture/#langserve)\n",
- "\n",
"Let's dive in!\n",
"\n",
"## Setup\n",
"\n",
"### Jupyter Notebook\n",
"\n",
- "This guide (and most of the other guides in the documentation) uses [Jupyter notebooks](https://jupyter.org/) and assumes the reader is as well. Jupyter notebooks are perfect for learning how to work with LLM systems because oftentimes things can go wrong (unexpected output, API down, etc) and going through guides in an interactive environment is a great way to better understand them.\n",
- "\n",
- "This and other tutorials are perhaps most conveniently run in a Jupyter notebook. See [here](https://jupyter.org/install) for instructions on how to install.\n",
+ "This and other tutorials are perhaps most conveniently run in a [Jupyter notebooks](https://jupyter.org/). Going through guides in an interactive environment is a great way to better understand them. See [here](https://jupyter.org/install) for instructions on how to install.\n",
"\n",
"### Installation\n",
"\n",
@@ -97,7 +91,7 @@
"\n",
"import ChatModelTabs from \"@theme/ChatModelTabs\";\n",
"\n",
- "\n"
+ "\n"
]
},
{
@@ -112,7 +106,7 @@
"\n",
"from langchain_openai import ChatOpenAI\n",
"\n",
- "model = ChatOpenAI(model=\"gpt-4\")"
+ "model = ChatOpenAI(model=\"gpt-4o\")"
]
},
{
@@ -120,22 +114,22 @@
"id": "ca5642ff",
"metadata": {},
"source": [
- "Let's first use the model directly. `ChatModel`s are instances of LangChain \"Runnables\", which means they expose a standard interface for interacting with them. To just simply call the model, we can pass in a list of messages to the `.invoke` method."
+ "Let's first use the model directly. [ChatModels](/docs/concepts/chat_models) are instances of LangChain [Runnables](/docs/concepts/runnables/), which means they expose a standard interface for interacting with them. To simply call the model, we can pass in a list of messages to the `.invoke` method."
]
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 2,
"id": "1b2481f0",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "AIMessage(content='ciao!', response_metadata={'token_usage': {'completion_tokens': 3, 'prompt_tokens': 20, 'total_tokens': 23}, 'model_name': 'gpt-4', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-fc5d7c88-9615-48ab-a3c7-425232b562c5-0')"
+ "AIMessage(content='Ciao!', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 3, 'prompt_tokens': 20, 'total_tokens': 23, 'completion_tokens_details': {'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0}, 'prompt_tokens_details': {'audio_tokens': 0, 'cached_tokens': 0}}, 'model_name': 'gpt-4o-2024-08-06', 'system_fingerprint': 'fp_9ee9e968ea', 'finish_reason': 'stop', 'logprobs': None}, id='run-ad371806-6082-45c3-b6fa-e44622848ab2-0', usage_metadata={'input_tokens': 20, 'output_tokens': 3, 'total_tokens': 23, 'input_token_details': {'audio': 0, 'cache_read': 0}, 'output_token_details': {'audio': 0, 'reasoning': 0}})"
]
},
- "execution_count": 16,
+ "execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
@@ -156,119 +150,9 @@
"id": "f83373db",
"metadata": {},
"source": [
- "If we've enabled LangSmith, we can see that this run is logged to LangSmith, and can see the [LangSmith trace](https://smith.langchain.com/public/88baa0b2-7c1a-4d09-ba30-a47985dde2ea/r)"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "32bd03ed",
- "metadata": {},
- "source": [
- "## OutputParsers\n",
- "\n",
- "Notice that the response from the model is an `AIMessage`. This contains a string response along with other metadata about the response. Oftentimes we may just want to work with the string response. We can parse out just this response by using a simple output parser.\n",
- "\n",
- "We first import the simple output parser."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 17,
- "id": "d7ae9c58",
- "metadata": {},
- "outputs": [],
- "source": [
- "from langchain_core.output_parsers import StrOutputParser\n",
- "\n",
- "parser = StrOutputParser()"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "eaebe33a",
- "metadata": {},
- "source": [
- "One way to use it is to use it by itself. For example, we could save the result of the language model call and then pass it to the parser."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 18,
- "id": "6bacb837",
- "metadata": {},
- "outputs": [],
- "source": [
- "result = model.invoke(messages)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 19,
- "id": "efb8da87",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "'Ciao!'"
- ]
- },
- "execution_count": 19,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "parser.invoke(result)"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "d508b79d",
- "metadata": {},
- "source": [
- "More commonly, we can \"chain\" the model with this output parser. This means this output parser will get called every time in this chain. This chain takes on the input type of the language model (string or list of message) and returns the output type of the output parser (string).\n",
+ "If we've enabled LangSmith, we can see that this run is logged to LangSmith, and can see the [LangSmith trace](https://smith.langchain.com/public/88baa0b2-7c1a-4d09-ba30-a47985dde2ea/r). The LangSmith trace reports [token](/docs/concepts/tokens/) usage information, latency, [standard model parameters](/docs/concepts/chat_models/#standard-parameters) (such as temperature), and other information.\n",
"\n",
- "We can easily create the chain using the `|` operator. The `|` operator is used in LangChain to combine two elements together."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 20,
- "id": "9449cfa6",
- "metadata": {},
- "outputs": [],
- "source": [
- "chain = model | parser"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 21,
- "id": "3e82f933",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "'Ciao!'"
- ]
- },
- "execution_count": 21,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "chain.invoke(messages)"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "dd009096",
- "metadata": {},
- "source": [
- "If we now look at LangSmith, we can see that the chain has two steps: first the language model is called, then the result of that is passed to the output parser. We can see the [LangSmith trace]( https://smith.langchain.com/public/f1bdf656-2739-42f7-ac7f-0f1dd712322f/r)"
+ "Note that ChatModels receive [message](/docs/concepts/messages/) objects as input and generate message objects as output. In addition to text content, message objects convey conversational [roles](/docs/concepts/messages/#role) and hold important data, such as [tool calls](/docs/concepts/tool_calling/) and token usage counts."
]
},
{
@@ -280,9 +164,9 @@
"\n",
"Right now we are passing a list of messages directly into the language model. Where does this list of messages come from? Usually, it is constructed from a combination of user input and application logic. This application logic usually takes the raw user input and transforms it into a list of messages ready to pass to the language model. Common transformations include adding a system message or formatting a template with the user input.\n",
"\n",
- "PromptTemplates are a concept in LangChain designed to assist with this transformation. They take in raw user input and return data (a prompt) that is ready to pass into a language model. \n",
+ "[Prompt templates](/docs/concepts/prompt_templates/) are a concept in LangChain designed to assist with this transformation. They take in raw user input and return data (a prompt) that is ready to pass into a language model. \n",
"\n",
- "Let's create a PromptTemplate here. It will take in two user variables:\n",
+ "Let's create a prompt template here. It will take in two user variables:\n",
"\n",
"- `language`: The language to translate text into\n",
"- `text`: The text to translate"
@@ -290,12 +174,18 @@
},
{
"cell_type": "code",
- "execution_count": 23,
+ "execution_count": 3,
"id": "3e73cc20",
"metadata": {},
"outputs": [],
"source": [
- "from langchain_core.prompts import ChatPromptTemplate"
+ "from langchain_core.prompts import ChatPromptTemplate\n",
+ "\n",
+ "system_template = \"Translate the following from English into {language}\"\n",
+ "\n",
+ "prompt_template = ChatPromptTemplate.from_messages(\n",
+ " [(\"system\", system_template), (\"user\", \"{text}\")]\n",
+ ")"
]
},
{
@@ -303,37 +193,7 @@
"id": "7e876c2a",
"metadata": {},
"source": [
- "First, let's create a string that we will format to be the system message:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 24,
- "id": "fd75ecde",
- "metadata": {},
- "outputs": [],
- "source": [
- "system_template = \"Translate the following into {language}:\""
- ]
- },
- {
- "cell_type": "markdown",
- "id": "fedf6f13",
- "metadata": {},
- "source": [
- "Next, we can create the PromptTemplate. This will be a combination of the `system_template` as well as a simpler template for where to put the text to be translated"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 25,
- "id": "88e566f3",
- "metadata": {},
- "outputs": [],
- "source": [
- "prompt_template = ChatPromptTemplate.from_messages(\n",
- " [(\"system\", system_template), (\"user\", \"{text}\")]\n",
- ")"
+ "Note that `ChatPromptTemplate` supports multiple [message roles](/docs/concepts/messages/#role) in a single template. We format the `language` parameter into the system message, and the user `text` into a user message."
]
},
{
@@ -346,23 +206,23 @@
},
{
"cell_type": "code",
- "execution_count": 27,
+ "execution_count": 4,
"id": "f781b3cb",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "ChatPromptValue(messages=[SystemMessage(content='Translate the following into italian:'), HumanMessage(content='hi')])"
+ "ChatPromptValue(messages=[SystemMessage(content='Translate the following from English into Italian', additional_kwargs={}, response_metadata={}), HumanMessage(content='hi!', additional_kwargs={}, response_metadata={})])"
]
},
- "execution_count": 27,
+ "execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "result = prompt_template.invoke({\"language\": \"italian\", \"text\": \"hi\"})\n",
+ "result = prompt_template.invoke({\"language\": \"Italian\", \"text\": \"hi!\"})\n",
"\n",
"result"
]
@@ -377,18 +237,18 @@
},
{
"cell_type": "code",
- "execution_count": 28,
+ "execution_count": 5,
"id": "2159b619",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "[SystemMessage(content='Translate the following into italian:'),\n",
- " HumanMessage(content='hi')]"
+ "[SystemMessage(content='Translate the following from English into Italian', additional_kwargs={}, response_metadata={}),\n",
+ " HumanMessage(content='hi!', additional_kwargs={}, response_metadata={})]"
]
},
- "execution_count": 28,
+ "execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
@@ -404,38 +264,36 @@
"source": [
"## Chaining together components with LCEL\n",
"\n",
- "We can now combine this with the model and the output parser from above using the pipe (`|`) operator:"
+ "We can now combine this with the model from above using the pipe (`|`) operator:"
]
},
{
"cell_type": "code",
- "execution_count": 29,
+ "execution_count": 6,
"id": "6c6beb4b",
"metadata": {},
"outputs": [],
"source": [
- "chain = prompt_template | model | parser"
+ "chain = prompt_template | model"
]
},
{
"cell_type": "code",
- "execution_count": 30,
+ "execution_count": 7,
"id": "3e45595a",
"metadata": {},
"outputs": [
{
- "data": {
- "text/plain": [
- "'ciao'"
- ]
- },
- "execution_count": 30,
- "metadata": {},
- "output_type": "execute_result"
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ciao!\n"
+ ]
}
],
"source": [
- "chain.invoke({\"language\": \"italian\", \"text\": \"hi\"})"
+ "response = chain.invoke({\"language\": \"Italian\", \"text\": \"hi!\"})\n",
+ "print(response.content)"
]
},
{
@@ -443,116 +301,14 @@
"id": "0b19cecb",
"metadata": {},
"source": [
- "This is a simple example of using [LangChain Expression Language (LCEL)](/docs/concepts/lcel) to chain together LangChain modules. There are several benefits to this approach, including optimized streaming and tracing support.\n",
+ ":::tip\n",
+ "Message `content` can contain both text and [content blocks](/docs/concepts/messages/#aimessage) with additional structure. See [this guide](/docs/how_to/output_parser_string/) for more information.\n",
+ ":::\n",
"\n",
- "If we take a look at the LangSmith trace, we can see all three components show up in the [LangSmith trace](https://smith.langchain.com/public/bc49bec0-6b13-4726-967f-dbd3448b786d/r)."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "a515ddd0",
- "metadata": {},
- "source": [
- "## Serving with LangServe\n",
- "\n",
- "Now that we've built an application, we need to serve it. That's where LangServe comes in.\n",
- "LangServe helps developers deploy LangChain chains as a REST API. You do not need to use LangServe to use LangChain, but in this guide we'll show how you can deploy your app with LangServe.\n",
- "\n",
- "While the first part of this guide was intended to be run in a Jupyter Notebook or script, we will now move out of that. We will be creating a Python file and then interacting with it from the command line.\n",
- "\n",
- "Install with:\n",
- "```bash\n",
- "pip install \"langserve[all]\"\n",
- "```\n",
- "\n",
- "### Server\n",
- "\n",
- "To create a server for our application we'll make a `serve.py` file. This will contain our logic for serving our application. It consists of three things:\n",
- "1. The definition of our chain that we just built above\n",
- "2. Our FastAPI app\n",
- "3. A definition of a route from which to serve the chain, which is done with `langserve.add_routes`\n",
- "\n",
- "\n",
- "```python\n",
- "#!/usr/bin/env python\n",
- "from fastapi import FastAPI\n",
- "from langchain_core.prompts import ChatPromptTemplate\n",
- "from langchain_core.output_parsers import StrOutputParser\n",
- "from langchain_openai import ChatOpenAI\n",
- "from langserve import add_routes\n",
- "\n",
- "# 1. Create prompt template\n",
- "system_template = \"Translate the following into {language}:\"\n",
- "prompt_template = ChatPromptTemplate.from_messages([\n",
- " ('system', system_template),\n",
- " ('user', '{text}')\n",
- "])\n",
- "\n",
- "# 2. Create model\n",
- "model = ChatOpenAI()\n",
- "\n",
- "# 3. Create parser\n",
- "parser = StrOutputParser()\n",
- "\n",
- "# 4. Create chain\n",
- "chain = prompt_template | model | parser\n",
- "\n",
- "# 5. App definition\n",
- "app = FastAPI(\n",
- " title=\"LangChain Server\",\n",
- " version=\"1.0\",\n",
- " description=\"A simple API server using LangChain's Runnable interfaces\",\n",
- ")\n",
- "\n",
- "# 6. Adding chain route\n",
- "add_routes(\n",
- " app,\n",
- " chain,\n",
- " path=\"/chain\",\n",
- ")\n",
- "\n",
- "if __name__ == \"__main__\":\n",
- " import uvicorn\n",
- "\n",
- " uvicorn.run(app, host=\"localhost\", port=8000)\n",
- "```\n",
- "\n",
- "And that's it! If we execute this file:\n",
- "```bash\n",
- "python serve.py\n",
- "```\n",
- "we should see our chain being served at [http://localhost:8000](http://localhost:8000).\n",
- "\n",
- "### Playground\n",
"\n",
- "Every LangServe service comes with a simple [built-in UI](https://github.com/langchain-ai/langserve/blob/main/README.md#playground) for configuring and invoking the application with streaming output and visibility into intermediate steps.\n",
- "Head to [http://localhost:8000/chain/playground/](http://localhost:8000/chain/playground/) to try it out! Pass in the same inputs as before - `{\"language\": \"italian\", \"text\": \"hi\"}` - and it should respond same as before.\n",
- "\n",
- "### Client\n",
+ "This is a simple example of using [LangChain Expression Language (LCEL)](/docs/concepts/lcel) to chain together LangChain modules. There are several benefits to this approach, including optimized streaming and tracing support.\n",
"\n",
- "Now let's set up a client for programmatically interacting with our service. We can easily do this with the [langserve.RemoteRunnable](/docs/langserve/#client).\n",
- "Using this, we can interact with the served chain as if it were running client-side."
- ]
- },
- {
- "cell_type": "markdown",
- "id": "96a19287-f3d5-42be-8338-5a5d749101b0",
- "metadata": {},
- "source": [
- "```python\n",
- "from langserve import RemoteRunnable\n",
- "\n",
- "remote_chain = RemoteRunnable(\"http://localhost:8000/chain/\")\n",
- "remote_chain.invoke({\"language\": \"italian\", \"text\": \"hi\"})\n",
- "```"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "480b78a9",
- "metadata": {},
- "source": [
- "To learn more about the many other features of LangServe [head here](/docs/langserve)."
+ "If we take a look at the [LangSmith trace](https://smith.langchain.com/public/bc49bec0-6b13-4726-967f-dbd3448b786d/r), we can see both components show up."
]
},
{
@@ -562,7 +318,7 @@
"source": [
"## Conclusion\n",
"\n",
- "That's it! In this tutorial you've learned how to create your first simple LLM application. You've learned how to work with language models, how to parse their outputs, how to create a prompt template, chaining them with LCEL, how to get great observability into chains you create with LangSmith, and how to deploy them with LangServe.\n",
+ "That's it! In this tutorial you've learned how to create your first simple LLM application. You've learned how to work with language models, how to how to create a prompt template, and how to get great observability into chains you create with LangSmith.\n",
"\n",
"This just scratches the surface of what you will want to learn to become a proficient AI Engineer. Luckily - we've got a lot of other resources!\n",
"\n",
@@ -570,11 +326,8 @@
"\n",
"If you have more specific questions on these concepts, check out the following sections of the how-to guides:\n",
"\n",
- "- [LangChain Expression Language (LCEL)](/docs/how_to/#langchain-expression-language-lcel)\n",
- "- [Prompt templates](/docs/how_to/#prompt-templates)\n",
"- [Chat models](/docs/how_to/#chat-models)\n",
- "- [Output parsers](/docs/how_to/#output-parsers)\n",
- "- [LangServe](/docs/langserve/)\n",
+ "- [Prompt templates](/docs/how_to/#prompt-templates)\n",
"\n",
"And the LangSmith docs:\n",
"\n",