BaseFakeCallbackHandlerMixin Class — langchain Architecture
Architecture documentation for the BaseFakeCallbackHandlerMixin class in _utils.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 9467e1fa_6130_05ef_040c_a465e50b1e84["BaseFakeCallbackHandlerMixin"] 542f3f1e_7782_84d9_777a_e16a365138ae["BaseFakeCallbackHandler"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|extends| 542f3f1e_7782_84d9_777a_e16a365138ae a5be47c5_0827_9b8a_9796_530e89d4bdb0["_utils.py"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|defined in| a5be47c5_0827_9b8a_9796_530e89d4bdb0 ce2fb4ce_7f7d_879b_77bd_fae8f8a3ecc5["on_llm_start_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| ce2fb4ce_7f7d_879b_77bd_fae8f8a3ecc5 bf0d3d54_1faa_e644_61c5_7646c2152d1d["on_llm_end_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| bf0d3d54_1faa_e644_61c5_7646c2152d1d 71931350_a574_1b97_a7b5_f6d3768e34da["on_llm_error_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| 71931350_a574_1b97_a7b5_f6d3768e34da 98aead3f_6fa9_8a0a_04b7_afb70a49a665["on_llm_new_token_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| 98aead3f_6fa9_8a0a_04b7_afb70a49a665 924581bd_46c3_6e67_74e2_42146e8e06ab["on_retry_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| 924581bd_46c3_6e67_74e2_42146e8e06ab a3eb8b50_d660_3ccf_11a8_e1dc56cc652a["on_chain_start_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| a3eb8b50_d660_3ccf_11a8_e1dc56cc652a 5db0601a_005b_2b73_2e9b_55a216a9ca85["on_chain_end_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| 5db0601a_005b_2b73_2e9b_55a216a9ca85 437c72ac_f140_9a91_c383_afbd41d52e67["on_chain_error_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| 437c72ac_f140_9a91_c383_afbd41d52e67 6806d838_838f_3ab9_d204_12bdd34ee988["on_tool_start_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| 6806d838_838f_3ab9_d204_12bdd34ee988 79726f7d_111d_ba67_38df_2b5038eef66d["on_tool_end_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| 79726f7d_111d_ba67_38df_2b5038eef66d 9291f8ed_40fd_51b8_b666_6c15384fadfa["on_tool_error_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| 9291f8ed_40fd_51b8_b666_6c15384fadfa 5a77833c_3e62_b57f_4e5c_5daa1c7347c7["on_agent_action_common()"] 9467e1fa_6130_05ef_040c_a465e50b1e84 -->|method| 5a77833c_3e62_b57f_4e5c_5daa1c7347c7
Relationship Graph
Source Code
libs/partners/anthropic/tests/unit_tests/_utils.py lines 44–111
class BaseFakeCallbackHandlerMixin(BaseFakeCallbackHandler):
"""Base fake callback handler mixin for testing."""
def on_llm_start_common(self) -> None:
self.llm_starts += 1
self.starts += 1
def on_llm_end_common(self) -> None:
self.llm_ends += 1
self.ends += 1
def on_llm_error_common(self) -> None:
self.errors += 1
def on_llm_new_token_common(self) -> None:
self.llm_streams += 1
def on_retry_common(self) -> None:
self.retries += 1
def on_chain_start_common(self) -> None:
self.chain_starts += 1
self.starts += 1
def on_chain_end_common(self) -> None:
self.chain_ends += 1
self.ends += 1
def on_chain_error_common(self) -> None:
self.errors += 1
def on_tool_start_common(self) -> None:
self.tool_starts += 1
self.starts += 1
def on_tool_end_common(self) -> None:
self.tool_ends += 1
self.ends += 1
def on_tool_error_common(self) -> None:
self.errors += 1
def on_agent_action_common(self) -> None:
self.agent_actions += 1
self.starts += 1
def on_agent_finish_common(self) -> None:
self.agent_ends += 1
self.ends += 1
def on_chat_model_start_common(self) -> None:
self.chat_model_starts += 1
self.starts += 1
def on_text_common(self) -> None:
self.text += 1
def on_retriever_start_common(self) -> None:
self.starts += 1
self.retriever_starts += 1
def on_retriever_end_common(self) -> None:
self.ends += 1
self.retriever_ends += 1
def on_retriever_error_common(self) -> None:
self.errors += 1
self.retriever_errors += 1
Extends
Source
Frequently Asked Questions
What is the BaseFakeCallbackHandlerMixin class?
BaseFakeCallbackHandlerMixin is a class in the langchain codebase, defined in libs/partners/anthropic/tests/unit_tests/_utils.py.
Where is BaseFakeCallbackHandlerMixin defined?
BaseFakeCallbackHandlerMixin is defined in libs/partners/anthropic/tests/unit_tests/_utils.py at line 44.
What does BaseFakeCallbackHandlerMixin extend?
BaseFakeCallbackHandlerMixin extends BaseFakeCallbackHandler.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free