Home / Function/ set() — langchain Function Reference

set() — langchain Function Reference

Architecture documentation for the set() function in entity.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  2e114e1c_3610_cc07_2105_0273d9788c9e["set()"]
  c539be70_4b09_e675_2ee4_a53dadca5460["RedisEntityStore"]
  2e114e1c_3610_cc07_2105_0273d9788c9e -->|defined in| c539be70_4b09_e675_2ee4_a53dadca5460
  0e0cff19_d2ca_577b_418f_fbadb36e11aa["set()"]
  2e114e1c_3610_cc07_2105_0273d9788c9e -->|calls| 0e0cff19_d2ca_577b_418f_fbadb36e11aa
  style 2e114e1c_3610_cc07_2105_0273d9788c9e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/memory/entity.py lines 299–310

    def set(self, key: str, value: str | None) -> None:
        if not value:
            return self.delete(key)
        self.redis_client.set(f"{self.full_key_prefix}:{key}", value, ex=self.ttl)
        logger.debug(
            "REDIS MEM set '%s:%s': '%s' EX %s",
            self.full_key_prefix,
            key,
            value,
            self.ttl,
        )
        return None

Domain

Subdomains

Calls

Frequently Asked Questions

What does set() do?
set() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/memory/entity.py.
Where is set() defined?
set() is defined in libs/langchain/langchain_classic/memory/entity.py at line 299.
What does set() call?
set() calls 1 function(s): set.

Analyze Your Own Codebase

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

Try Supermodel Free