Skip to content

Commit

Permalink
removed deprecated classes from pipelineai.ipynb, added support for L…
Browse files Browse the repository at this point in the history
…angChain v0.2 for PipelineAI integration (#24333)

Description: added support for LangChain v0.2 for PipelineAI
integration. Removed deprecated classes and incorporated support for
LangChain v0.2 to integrate with PipelineAI. Removed LLMChain and
replaced it with Runnable interface. Also added StrOutputParser, that
parses LLMResult into the top likely string.

Issue: None

Dependencies: None.

---------

Co-authored-by: Chester Curme <[email protected]>
  • Loading branch information
Srijan-D and ccurme authored Jul 17, 2024
1 parent e60ad12 commit 1792684
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/docs/integrations/llms/pipelineai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"source": [
"import os\n",
"\n",
"from langchain.chains import LLMChain\n",
"from langchain_community.llms import PipelineAI\n",
"from langchain_core.output_parsers import StrOutputParser\n",
"from langchain_core.prompts import PromptTemplate"
]
},
Expand Down Expand Up @@ -123,7 +123,7 @@
"metadata": {},
"outputs": [],
"source": [
"llm_chain = LLMChain(prompt=prompt, llm=llm)"
"llm_chain = prompt | llm | StrOutputParser()"
]
},
{
Expand All @@ -142,7 +142,7 @@
"source": [
"question = \"What NFL team won the Super Bowl in the year Justin Beiber was born?\"\n",
"\n",
"llm_chain.run(question)"
"llm_chain.invoke(question)"
]
}
],
Expand Down

0 comments on commit 1792684

Please sign in to comment.