Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
eyurtsev committed Jan 6, 2024
1 parent c2da719 commit 607a171
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/core/tests/unit_tests/runnables/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ def factory(session_id):
)

session = factory("abc")
session.clear()

chat_with_history = RunnableWithMessageHistory(
chat,
Expand All @@ -400,7 +401,10 @@ def factory(session_id):
config = {"configurable": {"session_id": "abc"}}

chat_with_history.invoke(HumanMessage(content="Hi! I'm Bob"), config=config)
assert session.messages[:2] == [
chat_with_history.invoke(HumanMessage(content="Hi! I'm Alice"), config=config)
assert session.messages == [
HumanMessage(content="Hi! I'm Bob"),
AIMessage(content="you said: Hi! I'm Bob"),
HumanMessage(content="Hi! I'm Alice"),
AIMessage(content="you said: Hi! I'm Bob\nHi! I'm Alice"),
]

0 comments on commit 607a171

Please sign in to comment.