mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-04 12:39:32 +00:00
langchain[patch]: deprecate AnalyzeDocumentChain (#23769)
This commit is contained in:
@@ -640,7 +640,7 @@
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Splitting and summarizing in a single chain\n",
|
||||
"For convenience, we can wrap both the text splitting of our long document and summarizing in a single `AnalyzeDocumentsChain`."
|
||||
"For convenience, we can wrap both the text splitting of our long document and summarizing in a single [chain](/docs/how_to/sequence):"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -650,12 +650,11 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from langchain.chains import AnalyzeDocumentChain\n",
|
||||
"def split_text(text: str):\n",
|
||||
" return text_splitter.create_documents([text])\n",
|
||||
"\n",
|
||||
"summarize_document_chain = AnalyzeDocumentChain(\n",
|
||||
" combine_docs_chain=chain, text_splitter=text_splitter\n",
|
||||
")\n",
|
||||
"summarize_document_chain.invoke(docs[0].page_content)"
|
||||
"\n",
|
||||
"summarize_document_chain = split_text | chain"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user