mirror of
https://github.com/kennethreitz/langchain.git
synced 2026-06-05 23:00:18 +00:00
@@ -7,7 +7,7 @@
|
||||
"source": [
|
||||
"# Adding Memory To an LLMChain\n",
|
||||
"\n",
|
||||
"This notebook goes over how to use the Memory class with an arbitrary chain. For the purposes of this walkthrough, we will add `ConversationBufferMemory` to a `LLMChain`."
|
||||
"This notebook goes over how to use the Memory class with an LLMChain. For the purposes of this walkthrough, we will add the `ConversationBufferMemory` class, although this can be any memory class."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -46,7 +46,7 @@
|
||||
" input_variables=[\"chat_history\", \"human_input\"], \n",
|
||||
" template=template\n",
|
||||
")\n",
|
||||
"memory = ConversationBufferMemory(dynamic_key=\"chat_history\")"
|
||||
"memory = ConversationBufferMemory(memory_key=\"chat_history\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -90,7 +90,7 @@
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"'\\n\\nHi there my friend! Thank you for talking with me.'"
|
||||
"' Hi there!'"
|
||||
]
|
||||
},
|
||||
"execution_count": 4,
|
||||
@@ -120,9 +120,7 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"Human: Hi there my friend\n",
|
||||
"AI: \n",
|
||||
"\n",
|
||||
"Hi there my friend! Thank you for talking with me.\n",
|
||||
"AI: Hi there!\n",
|
||||
"Human: Not to bad - how are you?\n",
|
||||
"Chatbot:\u001b[0m\n",
|
||||
"\n",
|
||||
@@ -132,7 +130,7 @@
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"\"\\n\\nI'm doing well, thank you for asking. How about you?\""
|
||||
"\"\\n\\nI'm doing well, thanks for asking. How about you?\""
|
||||
]
|
||||
},
|
||||
"execution_count": 5,
|
||||
|
||||
Reference in New Issue
Block a user