test_input_dict() — langchain Function Reference
Architecture documentation for the test_input_dict() function in test_history.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 974d7966_5254_bf08_09db_6d4176f81152["test_input_dict()"] 0af0dfde_fe33_f3e5_b5e6_a3d18260dc67["test_history.py"] 974d7966_5254_bf08_09db_6d4176f81152 -->|defined in| 0af0dfde_fe33_f3e5_b5e6_a3d18260dc67 e035a3b1_d1a1_c458_c801_af1fc0272f8b["_get_get_session_history()"] 974d7966_5254_bf08_09db_6d4176f81152 -->|calls| e035a3b1_d1a1_c458_c801_af1fc0272f8b style 974d7966_5254_bf08_09db_6d4176f81152 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/runnables/test_history.py lines 119–140
def test_input_dict() -> None:
runnable = RunnableLambda[Any, str](
lambda params: (
"you said: "
+ "\n".join(
str(m.content)
for m in params["messages"]
if isinstance(m, HumanMessage)
)
)
)
get_session_history = _get_get_session_history()
with_history = RunnableWithMessageHistory(
runnable, get_session_history, input_messages_key="messages"
)
config: RunnableConfig = {"configurable": {"session_id": "2"}}
output = with_history.invoke({"messages": [HumanMessage(content="hello")]}, config)
assert output == "you said: hello"
output = with_history.invoke(
{"messages": [HumanMessage(content="good bye")]}, config
)
assert output == "you said: hello\ngood bye"
Domain
Subdomains
Source
Frequently Asked Questions
What does test_input_dict() do?
test_input_dict() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_history.py.
Where is test_input_dict() defined?
test_input_dict() is defined in libs/core/tests/unit_tests/runnables/test_history.py at line 119.
What does test_input_dict() call?
test_input_dict() 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