Home / File/ __init__.py — langchain Source File

__init__.py — langchain Source File

Architecture documentation for __init__.py, a python file in the langchain codebase. 8 imports, 0 dependents.

File python CoreAbstractions Serialization 8 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  33c94418_796f_ec6a_2e56_9a1d403832ff["__init__.py"]
  8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3["typing"]
  33c94418_796f_ec6a_2e56_9a1d403832ff --> 8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3
  923d222e_e249_1c30_4cfe_3c907f050b78["langchain_core._import_utils"]
  33c94418_796f_ec6a_2e56_9a1d403832ff --> 923d222e_e249_1c30_4cfe_3c907f050b78
  7e64d143_ea36_1c73_4897_1d0ae1757b5b["langchain_core.callbacks.base"]
  33c94418_796f_ec6a_2e56_9a1d403832ff --> 7e64d143_ea36_1c73_4897_1d0ae1757b5b
  2f912a82_a81b_ae9b_b2e4_67c4cc20b715["langchain_core.callbacks.file"]
  33c94418_796f_ec6a_2e56_9a1d403832ff --> 2f912a82_a81b_ae9b_b2e4_67c4cc20b715
  e8ec017e_6c91_4b34_675f_2a96c5aa9be6["langchain_core.callbacks.manager"]
  33c94418_796f_ec6a_2e56_9a1d403832ff --> e8ec017e_6c91_4b34_675f_2a96c5aa9be6
  abb72023_d38b_8b3e_578b_e9c61bbab112["langchain_core.callbacks.stdout"]
  33c94418_796f_ec6a_2e56_9a1d403832ff --> abb72023_d38b_8b3e_578b_e9c61bbab112
  f21116c3_1640_4b87_430f_da973ee1de3f["langchain_core.callbacks.streaming_stdout"]
  33c94418_796f_ec6a_2e56_9a1d403832ff --> f21116c3_1640_4b87_430f_da973ee1de3f
  384ebb4e_cedc_3160_3d87_4109b79c8b82["langchain_core.callbacks.usage"]
  33c94418_796f_ec6a_2e56_9a1d403832ff --> 384ebb4e_cedc_3160_3d87_4109b79c8b82
  style 33c94418_796f_ec6a_2e56_9a1d403832ff fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Callback handlers allow listening to events in LangChain."""

from typing import TYPE_CHECKING

from langchain_core._import_utils import import_attr

if TYPE_CHECKING:
    from langchain_core.callbacks.base import (
        AsyncCallbackHandler,
        BaseCallbackHandler,
        BaseCallbackManager,
        CallbackManagerMixin,
        Callbacks,
        ChainManagerMixin,
        LLMManagerMixin,
        RetrieverManagerMixin,
        RunManagerMixin,
        ToolManagerMixin,
    )
    from langchain_core.callbacks.file import FileCallbackHandler
    from langchain_core.callbacks.manager import (
        AsyncCallbackManager,
        AsyncCallbackManagerForChainGroup,
        AsyncCallbackManagerForChainRun,
        AsyncCallbackManagerForLLMRun,
        AsyncCallbackManagerForRetrieverRun,
        AsyncCallbackManagerForToolRun,
        AsyncParentRunManager,
        AsyncRunManager,
        BaseRunManager,
        CallbackManager,
        CallbackManagerForChainGroup,
        CallbackManagerForChainRun,
        CallbackManagerForLLMRun,
        CallbackManagerForRetrieverRun,
        CallbackManagerForToolRun,
        ParentRunManager,
        RunManager,
        adispatch_custom_event,
        dispatch_custom_event,
    )
    from langchain_core.callbacks.stdout import StdOutCallbackHandler
    from langchain_core.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
    from langchain_core.callbacks.usage import (
        UsageMetadataCallbackHandler,
        get_usage_metadata_callback,
    )

__all__ = (
    "AsyncCallbackHandler",
    "AsyncCallbackManager",
    "AsyncCallbackManagerForChainGroup",
    "AsyncCallbackManagerForChainRun",
    "AsyncCallbackManagerForLLMRun",
    "AsyncCallbackManagerForRetrieverRun",
    "AsyncCallbackManagerForToolRun",
    "AsyncParentRunManager",
    "AsyncRunManager",
    "BaseCallbackHandler",
    "BaseCallbackManager",
// ... (73 more lines)

Subdomains

Dependencies

  • langchain_core._import_utils
  • langchain_core.callbacks.base
  • langchain_core.callbacks.file
  • langchain_core.callbacks.manager
  • langchain_core.callbacks.stdout
  • langchain_core.callbacks.streaming_stdout
  • langchain_core.callbacks.usage
  • typing

Frequently Asked Questions

What does __init__.py do?
__init__.py is a source file in the langchain codebase, written in python. It belongs to the CoreAbstractions domain, Serialization subdomain.
What functions are defined in __init__.py?
__init__.py defines 3 function(s): __dir__, __getattr__, langchain_core.
What does __init__.py depend on?
__init__.py imports 8 module(s): langchain_core._import_utils, langchain_core.callbacks.base, langchain_core.callbacks.file, langchain_core.callbacks.manager, langchain_core.callbacks.stdout, langchain_core.callbacks.streaming_stdout, langchain_core.callbacks.usage, typing.
Where is __init__.py in the architecture?
__init__.py is located at libs/core/langchain_core/callbacks/__init__.py (domain: CoreAbstractions, subdomain: Serialization, directory: libs/core/langchain_core/callbacks).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free