LangChain的提示词仓库的使用

以下返回有关深圳的qa对 。


from ChatGLM import ChatGLM_LLM
from langchain.chains import LLMChain

from langchain import hub
prompt1 = hub.pull("homanp/question-answer-pair")
llm = ChatGLM_LLM()
chain_one = LLMChain(
    llm=llm,
    prompt=prompt1,
    verbose=False
)

print(chain_one.invoke({"context":" 深圳","number_of_pairs":"10","data_format":  """
                        [{
                        "question": str, 
                        "answer": str}]
                        """ } ))


个人喜欢的提示词库:

https://smith.langchain.com/hub/smithing-gold/question-decomposition

你可能感兴趣的:(LangChain,langchain,python,java)