Home / Function/ _get_full_path() — langchain Function Reference

_get_full_path() — langchain Function Reference

Architecture documentation for the _get_full_path() function in file_system.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  60db82b3_b672_7a32_40bd_32b87d30a271["_get_full_path()"]
  26189a3b_3a87_0b57_a7a3_341b06895b61["LocalFileStore"]
  60db82b3_b672_7a32_40bd_32b87d30a271 -->|defined in| 26189a3b_3a87_0b57_a7a3_341b06895b61
  2519266e_27f4_b661_fa43_c386b4c1ef32["mget()"]
  2519266e_27f4_b661_fa43_c386b4c1ef32 -->|calls| 60db82b3_b672_7a32_40bd_32b87d30a271
  3a0a7a2c_34bc_b7f9_16d1_67eec3706628["mset()"]
  3a0a7a2c_34bc_b7f9_16d1_67eec3706628 -->|calls| 60db82b3_b672_7a32_40bd_32b87d30a271
  a12d1084_c2b3_8eeb_5588_395855d5b285["mdelete()"]
  a12d1084_c2b3_8eeb_5588_395855d5b285 -->|calls| 60db82b3_b672_7a32_40bd_32b87d30a271
  967e8c30_eae3_c5ff_bf36_9f8ef2e82c28["yield_keys()"]
  967e8c30_eae3_c5ff_bf36_9f8ef2e82c28 -->|calls| 60db82b3_b672_7a32_40bd_32b87d30a271
  style 60db82b3_b672_7a32_40bd_32b87d30a271 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/storage/file_system.py lines 65–87

    def _get_full_path(self, key: str) -> Path:
        """Get the full path for a given key relative to the root path.

        Args:
            key: The key relative to the root path.

        Returns:
            The full path for the given key.
        """
        if not re.match(r"^[a-zA-Z0-9_.\-/]+$", key):
            msg = f"Invalid characters in key: {key}"
            raise InvalidKeyException(msg)
        full_path = (self.root_path / key).resolve()
        root_path = self.root_path.resolve()
        common_path = os.path.commonpath([root_path, full_path])
        if common_path != str(root_path):
            msg = (
                f"Invalid key: {key}. Key should be relative to the full path. "
                f"{root_path} vs. {common_path} and full path of {full_path}"
            )
            raise InvalidKeyException(msg)

        return full_path

Domain

Subdomains

Frequently Asked Questions

What does _get_full_path() do?
_get_full_path() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/storage/file_system.py.
Where is _get_full_path() defined?
_get_full_path() is defined in libs/langchain/langchain_classic/storage/file_system.py at line 65.
What calls _get_full_path()?
_get_full_path() is called by 4 function(s): mdelete, mget, mset, yield_keys.

Analyze Your Own Codebase

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

Try Supermodel Free