forked from Archives/langchain
59 lines
1.1 KiB
Plaintext
59 lines
1.1 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# LLMCheckerChain\n",
|
||
|
"This notebook showcases how to use LLMCheckerChain."
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"from langchain.chains import LLMCheckerChain\n",
|
||
|
"from langchain.llms import OpenAI\n",
|
||
|
"\n",
|
||
|
"llm = OpenAI(temperature=0.7)\n",
|
||
|
"\n",
|
||
|
"text = \"What type of mammal lays the biggest eggs?\"\n",
|
||
|
"\n",
|
||
|
"checker_chain = LLMCheckerChain(llm=llm, verbose=True)\n",
|
||
|
"\n",
|
||
|
"checker_chain.run(text)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3",
|
||
|
"language": "python",
|
||
|
"name": "python3"
|
||
|
},
|
||
|
"language_info": {
|
||
|
"codemirror_mode": {
|
||
|
"name": "ipython",
|
||
|
"version": 3
|
||
|
},
|
||
|
"file_extension": ".py",
|
||
|
"mimetype": "text/x-python",
|
||
|
"name": "python",
|
||
|
"nbconvert_exporter": "python",
|
||
|
"pygments_lexer": "ipython3",
|
||
|
"version": "3.9.12"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 4
|
||
|
}
|