Home / File/ __init__.py — langchain Source File

__init__.py — langchain Source File

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

File python CoreAbstractions Serialization 10 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  371b4491_700c_6e1f_73f9_c8c22bc91010["__init__.py"]
  8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3["typing"]
  371b4491_700c_6e1f_73f9_c8c22bc91010 --> 8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3
  923d222e_e249_1c30_4cfe_3c907f050b78["langchain_core._import_utils"]
  371b4491_700c_6e1f_73f9_c8c22bc91010 --> 923d222e_e249_1c30_4cfe_3c907f050b78
  c764ccae_0d75_abec_7c23_6d5d1949a7ba["langchain_core.runnables.base"]
  371b4491_700c_6e1f_73f9_c8c22bc91010 --> c764ccae_0d75_abec_7c23_6d5d1949a7ba
  f1e64c4c_82da_99a7_94cd_34029fba00c9["langchain_core.runnables.branch"]
  371b4491_700c_6e1f_73f9_c8c22bc91010 --> f1e64c4c_82da_99a7_94cd_34029fba00c9
  2971f9da_6393_a3e3_610e_ace3d35ee978["langchain_core.runnables.config"]
  371b4491_700c_6e1f_73f9_c8c22bc91010 --> 2971f9da_6393_a3e3_610e_ace3d35ee978
  52df47fe_962b_0b0c_44d7_f32e74a5eaf7["langchain_core.runnables.fallbacks"]
  371b4491_700c_6e1f_73f9_c8c22bc91010 --> 52df47fe_962b_0b0c_44d7_f32e74a5eaf7
  bc13118c_5da1_3177_a1c9_a819646e57b5["langchain_core.runnables.history"]
  371b4491_700c_6e1f_73f9_c8c22bc91010 --> bc13118c_5da1_3177_a1c9_a819646e57b5
  ccefef62_d528_10d6_038f_4f36b848797d["langchain_core.runnables.passthrough"]
  371b4491_700c_6e1f_73f9_c8c22bc91010 --> ccefef62_d528_10d6_038f_4f36b848797d
  1e6463cb_b7bb_cbb7_4a56_5c1c4dff0099["langchain_core.runnables.router"]
  371b4491_700c_6e1f_73f9_c8c22bc91010 --> 1e6463cb_b7bb_cbb7_4a56_5c1c4dff0099
  81c04601_d095_a27d_4af1_55e771bb2b6b["langchain_core.runnables.utils"]
  371b4491_700c_6e1f_73f9_c8c22bc91010 --> 81c04601_d095_a27d_4af1_55e771bb2b6b
  style 371b4491_700c_6e1f_73f9_c8c22bc91010 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""LangChain **Runnable** and the **LangChain Expression Language (LCEL)**.

The LangChain Expression Language (LCEL) offers a declarative method to build
production-grade programs that harness the power of LLMs.

Programs created using LCEL and LangChain `Runnable` objects inherently suppor
synchronous asynchronous, batch, and streaming operations.

Support for **async** allows servers hosting LCEL based programs to scale bette for
higher concurrent loads.

**Batch** operations allow for processing multiple inputs in parallel.

**Streaming** of intermediate outputs, as they're being generated, allows for creating
more responsive UX.

This module contains schema and implementation of LangChain `Runnable` object
primitives.
"""

from typing import TYPE_CHECKING

from langchain_core._import_utils import import_attr

if TYPE_CHECKING:
    from langchain_core.runnables.base import (
        Runnable,
        RunnableBinding,
        RunnableGenerator,
        RunnableLambda,
        RunnableMap,
        RunnableParallel,
        RunnableSequence,
        RunnableSerializable,
        chain,
    )
    from langchain_core.runnables.branch import RunnableBranch
    from langchain_core.runnables.config import (
        RunnableConfig,
        ensure_config,
        get_config_list,
        patch_config,
        run_in_executor,
    )
    from langchain_core.runnables.fallbacks import RunnableWithFallbacks
    from langchain_core.runnables.history import RunnableWithMessageHistory
    from langchain_core.runnables.passthrough import (
        RunnableAssign,
        RunnablePassthrough,
        RunnablePick,
    )
    from langchain_core.runnables.router import RouterInput, RouterRunnable
    from langchain_core.runnables.utils import (
        AddableDict,
        ConfigurableField,
        ConfigurableFieldMultiOption,
        ConfigurableFieldSingleOption,
        ConfigurableFieldSpec,
        aadd,
        add,
// ... (77 more lines)

Subdomains

Dependencies

  • langchain_core._import_utils
  • langchain_core.runnables.base
  • langchain_core.runnables.branch
  • langchain_core.runnables.config
  • langchain_core.runnables.fallbacks
  • langchain_core.runnables.history
  • langchain_core.runnables.passthrough
  • langchain_core.runnables.router
  • langchain_core.runnables.utils
  • 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 10 module(s): langchain_core._import_utils, langchain_core.runnables.base, langchain_core.runnables.branch, langchain_core.runnables.config, langchain_core.runnables.fallbacks, langchain_core.runnables.history, langchain_core.runnables.passthrough, langchain_core.runnables.router, and 2 more.
Where is __init__.py in the architecture?
__init__.py is located at libs/core/langchain_core/runnables/__init__.py (domain: CoreAbstractions, subdomain: Serialization, directory: libs/core/langchain_core/runnables).

Analyze Your Own Codebase

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

Try Supermodel Free