From 68e0ae32864ae9251e447d7c580d9330131721e1 Mon Sep 17 00:00:00 2001 From: ccurme Date: Mon, 24 Jun 2024 17:51:29 -0400 Subject: [PATCH] langchain[patch]: update removal target for LLMChain (#23373) to 1.0 Also improve replacement example in docstring. --- libs/langchain/langchain/chains/llm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/langchain/langchain/chains/llm.py b/libs/langchain/langchain/chains/llm.py index 874cfa96fa..e90578e4c8 100644 --- a/libs/langchain/langchain/chains/llm.py +++ b/libs/langchain/langchain/chains/llm.py @@ -38,7 +38,7 @@ from langchain.chains.base import Chain @deprecated( since="0.1.17", alternative="RunnableSequence, e.g., `prompt | llm`", - removal="0.3.0", + removal="1.0", ) class LLMChain(Chain): """Chain to run queries against LLMs. @@ -48,6 +48,7 @@ class LLMChain(Chain): .. code-block:: python + from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import PromptTemplate from langchain_openai import OpenAI @@ -56,7 +57,7 @@ class LLMChain(Chain): input_variables=["adjective"], template=prompt_template ) llm = OpenAI() - chain = prompt | llm + chain = prompt | llm | StrOutputParser() chain.invoke("your adjective here")