Harrison/add human prefix (#520)

Co-authored-by: Andrew Huang <jhuang16888@gmail.com>
This commit is contained in:
Harrison Chase
2023-01-03 08:03:50 -08:00
committed by GitHub
parent 03f185bcd5
commit 0db05b6725
3 changed files with 144 additions and 8 deletions

View File

@@ -19,6 +19,13 @@ def test_memory_ai_prefix() -> None:
assert memory.buffer == "\nHuman: bar\nAssistant: foo"
def test_memory_human_prefix() -> None:
"""Test that human_prefix in the memory component works."""
memory = ConversationBufferMemory(memory_key="foo", human_prefix="Friend")
memory.save_context({"input": "bar"}, {"output": "foo"})
assert memory.buffer == "\nFriend: bar\nAI: foo"
def test_conversation_chain_works() -> None:
"""Test that conversation chain works in basic setting."""
llm = FakeLLM()