Home / File/ base.py — langchain Source File

base.py — langchain Source File

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

File python CoreAbstractions Serialization 36 imports 5 functions 14 classes

Entity Profile

Dependency Diagram

graph LR
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214["base.py"]
  a327e534_84f6_5308_58ca_5727d5eda0cf["asyncio"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> a327e534_84f6_5308_58ca_5727d5eda0cf
  efd68536_3a44_76e4_ec2a_0ec171774703["collections"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> efd68536_3a44_76e4_ec2a_0ec171774703
  69e1d8cc_6173_dcd0_bfdf_2132d8e1ce56["contextlib"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> 69e1d8cc_6173_dcd0_bfdf_2132d8e1ce56
  c990f2d7_9509_7cea_ca95_51ad57dbe5c6["functools"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> c990f2d7_9509_7cea_ca95_51ad57dbe5c6
  614e7b9f_ed51_0780_749c_ff40b74963fc["inspect"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> 614e7b9f_ed51_0780_749c_ff40b74963fc
  242d0b7d_a8ef_b66d_169b_c791b32a9cc9["threading"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> 242d0b7d_a8ef_b66d_169b_c791b32a9cc9
  cccbe73e_4644_7211_4d55_e8fb133a8014["abc"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> cccbe73e_4644_7211_4d55_e8fb133a8014
  cfe2bde5_180e_e3b0_df2b_55b3ebaca8e7["collections.abc"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> cfe2bde5_180e_e3b0_df2b_55b3ebaca8e7
  082415a8_067b_221f_7984_07d87009267d["concurrent.futures"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> 082415a8_067b_221f_7984_07d87009267d
  436f77bc_653d_0edb_555c_c2679d5a59ac["itertools"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> 436f77bc_653d_0edb_555c_c2679d5a59ac
  7aaf52d4_ee88_411e_980e_bc4beeeb30ad["operator"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> 7aaf52d4_ee88_411e_980e_bc4beeeb30ad
  05bcd40b_a309_8a05_c2c6_59e32e113cf5["types"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> 05bcd40b_a309_8a05_c2c6_59e32e113cf5
  8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3["typing"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> 8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3
  6e58aaea_f08e_c099_3cc7_f9567bfb1ae7["pydantic"]
  5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 --> 6e58aaea_f08e_c099_3cc7_f9567bfb1ae7
  style 5f3c1f1c_6f8a_e293_7cb5_97c21b4bf214 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Base classes and utilities for `Runnable` objects."""

from __future__ import annotations

import asyncio
import collections
import contextlib
import functools
import inspect
import threading
from abc import ABC, abstractmethod
from collections.abc import (
    AsyncGenerator,
    AsyncIterator,
    Awaitable,
    Callable,
    Coroutine,
    Iterator,
    Mapping,
    Sequence,
)
from concurrent.futures import FIRST_COMPLETED, wait
from functools import wraps
from itertools import tee
from operator import itemgetter
from types import GenericAlias
from typing import (
    TYPE_CHECKING,
    Any,
    Generic,
    Literal,
    Protocol,
    TypeVar,
    cast,
    get_args,
    get_type_hints,
    overload,
)

from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import override

from langchain_core._api import beta_decorator
from langchain_core.callbacks.manager import AsyncCallbackManager, CallbackManager
from langchain_core.load.serializable import (
    Serializable,
    SerializedConstructor,
    SerializedNotImplemented,
)
from langchain_core.runnables.config import (
    RunnableConfig,
    acall_func_with_variable_args,
    call_func_with_variable_args,
    ensure_config,
    get_async_callback_manager_for_config,
    get_callback_manager_for_config,
    get_config_list,
    get_executor_for_config,
    merge_configs,
    patch_config,
// ... (6202 more lines)

Subdomains

Dependencies

  • abc
  • asyncio
  • collections
  • collections.abc
  • concurrent.futures
  • contextlib
  • functools
  • inspect
  • itertools
  • langchain_core._api
  • langchain_core.callbacks.manager
  • langchain_core.load.serializable
  • langchain_core.prompts.base
  • langchain_core.runnables.config
  • langchain_core.runnables.configurable
  • langchain_core.runnables.fallbacks
  • langchain_core.runnables.graph
  • langchain_core.runnables.passthrough
  • langchain_core.runnables.retry
  • langchain_core.runnables.schema
  • langchain_core.runnables.utils
  • langchain_core.tools
  • langchain_core.tracers._streaming
  • langchain_core.tracers.event_stream
  • langchain_core.tracers.log_stream
  • langchain_core.tracers.root_listeners
  • langchain_core.tracers.schemas
  • langchain_core.utils.aiter
  • langchain_core.utils.iter
  • langchain_core.utils.pydantic
  • operator
  • pydantic
  • threading
  • types
  • typing
  • typing_extensions

Frequently Asked Questions

What does base.py do?
base.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 base.py?
base.py defines 5 function(s): _seq_input_schema, _seq_output_schema, chain, coerce_to_runnable, langchain_core.
What does base.py depend on?
base.py imports 36 module(s): abc, asyncio, collections, collections.abc, concurrent.futures, contextlib, functools, inspect, and 28 more.
Where is base.py in the architecture?
base.py is located at libs/core/langchain_core/runnables/base.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