FakeChain Class — langchain Architecture
Architecture documentation for the FakeChain class in test_base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 3765bfcc_b5a9_3ceb_55b5_8f5ca217f561["FakeChain"] f3cef70e_11b0_61c9_7ec0_7308f4b45056["Chain"] 3765bfcc_b5a9_3ceb_55b5_8f5ca217f561 -->|extends| f3cef70e_11b0_61c9_7ec0_7308f4b45056 cbc5b920_9825_eac5_8cc4_bc8187fb214c["test_base.py"] 3765bfcc_b5a9_3ceb_55b5_8f5ca217f561 -->|defined in| cbc5b920_9825_eac5_8cc4_bc8187fb214c 9028ab6b_0fa9_940c_98c3_536a7e2d2285["input_keys()"] 3765bfcc_b5a9_3ceb_55b5_8f5ca217f561 -->|method| 9028ab6b_0fa9_940c_98c3_536a7e2d2285 09b39aa3_226f_77f0_54dc_0868122884af["output_keys()"] 3765bfcc_b5a9_3ceb_55b5_8f5ca217f561 -->|method| 09b39aa3_226f_77f0_54dc_0868122884af facc7f34_6e73_d7f9_19ad_3b7e6a4c6d3f["_call()"] 3765bfcc_b5a9_3ceb_55b5_8f5ca217f561 -->|method| facc7f34_6e73_d7f9_19ad_3b7e6a4c6d3f
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/chains/test_base.py lines 41–66
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]:
if self.be_correct:
return {"bar": "baz"}
return {"baz": "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/chains/test_base.py.
Where is FakeChain defined?
FakeChain is defined in libs/langchain/tests/unit_tests/chains/test_base.py at line 41.
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