FakeChain Class — langchain Architecture
Architecture documentation for the FakeChain class in test_file.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 82b29701_3ebe_8165_dfa2_2528e0594b83["FakeChain"] f3cef70e_11b0_61c9_7ec0_7308f4b45056["Chain"] 82b29701_3ebe_8165_dfa2_2528e0594b83 -->|extends| f3cef70e_11b0_61c9_7ec0_7308f4b45056 208c1f71_5b87_0580_ea58_7fe3e9a67452["test_file.py"] 82b29701_3ebe_8165_dfa2_2528e0594b83 -->|defined in| 208c1f71_5b87_0580_ea58_7fe3e9a67452 ff7d9c65_9d41_a93d_95d5_b8d2f0389788["input_keys()"] 82b29701_3ebe_8165_dfa2_2528e0594b83 -->|method| ff7d9c65_9d41_a93d_95d5_b8d2f0389788 fe3d10c8_2b4c_6b03_d5bc_6cca48809bba["output_keys()"] 82b29701_3ebe_8165_dfa2_2528e0594b83 -->|method| fe3d10c8_2b4c_6b03_d5bc_6cca48809bba 55f4d281_295f_6880_d29c_3f1b8b8963b9["_call()"] 82b29701_3ebe_8165_dfa2_2528e0594b83 -->|method| 55f4d281_295f_6880_d29c_3f1b8b8963b9
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/callbacks/test_file.py lines 11–34
class FakeChain(Chain):
"""Fake chain class for testing purposes."""
be_correct: bool = True
the_input_keys: list[str] = ["foo"]
the_output_keys: list[str] = ["bar"]
@property
def input_keys(self) -> list[str]:
"""Input keys."""
return self.the_input_keys
@property
def output_keys(self) -> list[str]:
"""Output key of bar."""
return self.the_output_keys
@override
def _call(
self,
inputs: dict[str, str],
run_manager: CallbackManagerForChainRun | None = None,
) -> dict[str, str]:
return {"bar": "bar"}
Extends
Source
Frequently Asked Questions
What is the FakeChain class?
FakeChain is a class in the langchain codebase, defined in libs/langchain/tests/unit_tests/callbacks/test_file.py.
Where is FakeChain defined?
FakeChain is defined in libs/langchain/tests/unit_tests/callbacks/test_file.py at line 11.
What does FakeChain extend?
FakeChain extends Chain.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free