Home / Function/ _get_default_allowed_class_paths() — langchain Function Reference

_get_default_allowed_class_paths() — langchain Function Reference

Architecture documentation for the _get_default_allowed_class_paths() function in load.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  5f6f100d_cc37_3378_9551_a884d0722393["_get_default_allowed_class_paths()"]
  05e0e20a_4425_e962_37a4_c6c6f08a700d["load.py"]
  5f6f100d_cc37_3378_9551_a884d0722393 -->|defined in| 05e0e20a_4425_e962_37a4_c6c6f08a700d
  b3f6aa7f_cc79_a63c_c7f8_32c14bbf6343["__init__()"]
  b3f6aa7f_cc79_a63c_c7f8_32c14bbf6343 -->|calls| 5f6f100d_cc37_3378_9551_a884d0722393
  style 5f6f100d_cc37_3378_9551_a884d0722393 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/load/load.py lines 124–149

def _get_default_allowed_class_paths(
    allowed_object_mode: Literal["all", "core"],
) -> set[tuple[str, ...]]:
    """Get the default allowed class paths from the serialization mappings.

    This uses the mappings as the source of truth for what classes are allowed
    by default. Both the legacy paths (keys) and current paths (values) are included.

    Args:
        allowed_object_mode: either `'all'` or `'core'`.

    Returns:
        Set of class path tuples that are allowed by default.
    """
    if allowed_object_mode in _default_class_paths_cache:
        return _default_class_paths_cache[allowed_object_mode]

    allowed_paths: set[tuple[str, ...]] = set()
    for key, value in ALL_SERIALIZABLE_MAPPINGS.items():
        if allowed_object_mode == "core" and value[0] != "langchain_core":
            continue
        allowed_paths.add(key)
        allowed_paths.add(value)

    _default_class_paths_cache[allowed_object_mode] = allowed_paths
    return _default_class_paths_cache[allowed_object_mode]

Subdomains

Called By

Frequently Asked Questions

What does _get_default_allowed_class_paths() do?
_get_default_allowed_class_paths() is a function in the langchain codebase, defined in libs/core/langchain_core/load/load.py.
Where is _get_default_allowed_class_paths() defined?
_get_default_allowed_class_paths() is defined in libs/core/langchain_core/load/load.py at line 124.
What calls _get_default_allowed_class_paths()?
_get_default_allowed_class_paths() is called by 1 function(s): __init__.

Analyze Your Own Codebase

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

Try Supermodel Free