Skip to main content

自检链

这个笔记本展示了如何使用LLMCheckerChain。

from langchain.chains import LLMCheckerChain
from langchain.llms import OpenAI

llm = OpenAI(temperature=0.7)
text = "What type of mammal lays the biggest eggs?"

checker_chain = LLMCheckerChain.from_llm(llm, verbose=True)
checker_chain.run(text)
> Entering new LLMCheckerChain chain...


> Entering new SequentialChain chain...

> Finished chain.

> Finished chain.





'没有哺乳动物能够产下最大的蛋。大象鸟是一种巨鸟,它的蛋是所有鸟类中最大的。'