__post_init__() — langchain Function Reference
Architecture documentation for the __post_init__() function in _execution.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 67f4d214_e3bb_d1b8_e7f8_0f36f4a3e6aa["__post_init__()"] 489b9db3_8221_6964_1dd6_b6ee6fd2e645["HostExecutionPolicy"] 67f4d214_e3bb_d1b8_e7f8_0f36f4a3e6aa -->|defined in| 489b9db3_8221_6964_1dd6_b6ee6fd2e645 style 67f4d214_e3bb_d1b8_e7f8_0f36f4a3e6aa fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/langchain/agents/middleware/_execution.py lines 113–129
def __post_init__(self) -> None:
super().__post_init__()
if self.cpu_time_seconds is not None and self.cpu_time_seconds <= 0:
msg = "cpu_time_seconds must be positive if provided."
raise ValueError(msg)
if self.memory_bytes is not None and self.memory_bytes <= 0:
msg = "memory_bytes must be positive if provided."
raise ValueError(msg)
self._limits_requested = any(
value is not None for value in (self.cpu_time_seconds, self.memory_bytes)
)
if self._limits_requested and not _HAS_RESOURCE:
msg = (
"HostExecutionPolicy cpu/memory limits require the Python 'resource' module. "
"Either remove the limits or run on a POSIX platform."
)
raise RuntimeError(msg)
Domain
Subdomains
Source
Frequently Asked Questions
What does __post_init__() do?
__post_init__() is a function in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/_execution.py.
Where is __post_init__() defined?
__post_init__() is defined in libs/langchain_v1/langchain/agents/middleware/_execution.py at line 113.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free