Home / Function/ __new__() — langchain Function Reference

__new__() — langchain Function Reference

Architecture documentation for the __new__() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  509ec812_4c63_30d7_e52d_5b7d54a5826c["__new__()"]
  878fd31a_61cf_3199_2764_5308cc207a9b["TextAccessor"]
  509ec812_4c63_30d7_e52d_5b7d54a5826c -->|defined in| 878fd31a_61cf_3199_2764_5308cc207a9b
  style 509ec812_4c63_30d7_e52d_5b7d54a5826c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/messages/base.py lines 64–66

    def __new__(cls, value: str) -> Self:
        """Create new TextAccessor instance."""
        return str.__new__(cls, value)

Domain

Subdomains

Frequently Asked Questions

What does __new__() do?
__new__() is a function in the langchain codebase, defined in libs/core/langchain_core/messages/base.py.
Where is __new__() defined?
__new__() is defined in libs/core/langchain_core/messages/base.py at line 64.

Analyze Your Own Codebase

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

Try Supermodel Free