赞
踩
import ChatGLM from langchain.chains import LLMChain from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemplate from langchain.chains import SimpleSequentialChain from operator import itemgetter from langchain_community.document_loaders import PyPDFLoader import ChatGLM from langchain_community.tools.tavily_search import TavilySearchResults from langchain.chains import LLMMathChain from langchain_community.document_loaders import TextLoader from langchain.text_splitter import CharacterTextSplitter from langchain_community.vectorstores import Chroma from langchain_core.runnables import RunnableParallel, RunnablePassthrough from langchain_community.embeddings import JinaEmbeddings from langchain.chains.combine_documents import create_stuff_documents_chain from langchain.chains import create_retrieval_chain from langchain.chains.summarize import load_summarize_chain from langchain_community.document_loaders import WebBaseLoader llm = ChatGLM.ChatGLM_LLM() loader = WebBaseLoader("https://www.163.com/dy/article/IQ6PGRNT0514BQ68.html") documents = loader.load() chain = load_summarize_chain(llm, chain_type="stuff") print(chain.run(documents))
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。