test_get_output_messages_with_value_error() — langchain Function Reference
Architecture documentation for the test_get_output_messages_with_value_error() function in test_history.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 7e7251de_e987_dd54_2b1c_2792242cc91a["test_get_output_messages_with_value_error()"] 0af0dfde_fe33_f3e5_b5e6_a3d18260dc67["test_history.py"] 7e7251de_e987_dd54_2b1c_2792242cc91a -->|defined in| 0af0dfde_fe33_f3e5_b5e6_a3d18260dc67 e035a3b1_d1a1_c458_c801_af1fc0272f8b["_get_get_session_history()"] 7e7251de_e987_dd54_2b1c_2792242cc91a -->|calls| e035a3b1_d1a1_c458_c801_af1fc0272f8b style 7e7251de_e987_dd54_2b1c_2792242cc91a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/runnables/test_history.py lines 877–906
def test_get_output_messages_with_value_error() -> None:
illegal_bool_message = False
runnable = _RunnableLambdaWithRaiseError[Any, bool](lambda _: illegal_bool_message)
get_session_history = _get_get_session_history()
with_history = RunnableWithMessageHistory(runnable, get_session_history) # type: ignore[arg-type]
config: RunnableConfig = {
"configurable": {"session_id": "1", "message_history": get_session_history("1")}
}
with pytest.raises(
ValueError,
match=re.escape(
"Expected str, BaseMessage, list[BaseMessage], or tuple[BaseMessage]."
f" Got {illegal_bool_message}."
),
):
with_history.bound.invoke([HumanMessage(content="hello")], config)
illegal_int_message = 123
runnable2 = _RunnableLambdaWithRaiseError[Any, int](lambda _: illegal_int_message)
with_history = RunnableWithMessageHistory(runnable2, get_session_history) # type: ignore[arg-type]
with pytest.raises(
ValueError,
match=re.escape(
"Expected str, BaseMessage, list[BaseMessage], or tuple[BaseMessage]."
f" Got {illegal_int_message}."
),
):
with_history.bound.invoke([HumanMessage(content="hello")], config)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_get_output_messages_with_value_error() do?
test_get_output_messages_with_value_error() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_history.py.
Where is test_get_output_messages_with_value_error() defined?
test_get_output_messages_with_value_error() is defined in libs/core/tests/unit_tests/runnables/test_history.py at line 877.
What does test_get_output_messages_with_value_error() call?
test_get_output_messages_with_value_error() calls 1 function(s): _get_get_session_history.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free