需要去千问的官网申请你自己的api key ,替换下面的。
#!pip install langchain langchainhub dashscope
from langchain_core.prompts import ChatPromptTemplate
from langchain.chains import LLMChain
from langchain_community.llms import Tongyi
from langchain import hub
import os
prompt1 = ChatPromptTemplate.from_template("""{input}
"""
)
os