"This notebook showcases using a generic transformation chain.\n",
"Often we want to transform inputs as they are passed from one component to another.\n",
"\n",
"As an example, we will create a dummy transformation that takes in a super long text, filters the text to only the first 3 paragraphs, and then passes that into an `LLMChain` to summarize those."
"As an example, we will create a dummy transformation that takes in a super long text, filters the text to only the first 3 paragraphs, and then passes that into a chain to summarize those."
"With LCEL this is trivial, since we can add functions in any `RunnableSequence`."
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 17,
"id": "1e53e851-b1bd-424f-a144-5f2e8b413dcf",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'The speaker acknowledges the presence of important figures in the government and addresses the audience as fellow Americans. They highlight the impact of COVID-19 on keeping people apart in the previous year but express joy in being able to come together again. The speaker emphasizes the unity of Democrats, Republicans, and Independents as Americans.'"
"' The speaker addresses the nation, noting that while last year they were kept apart due to COVID-19, this year they are together again. They are reminded that regardless of their political affiliations, they are all Americans.'"
"' In an address to the nation, the speaker acknowledges the hardships of the past year due to the COVID-19 pandemic, but emphasizes that regardless of political affiliation, all Americans can come together.'"