__getattr__() — langchain Function Reference
Architecture documentation for the __getattr__() function in __init__.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 1cebb74c_2e0e_ef84_e06a_34716e9c5845["__getattr__()"] 0d41971e_bef3_16cd_c28c_25a93af172c1["__init__.py"] 1cebb74c_2e0e_ef84_e06a_34716e9c5845 -->|defined in| 0d41971e_bef3_16cd_c28c_25a93af172c1 style 1cebb74c_2e0e_ef84_e06a_34716e9c5845 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/chat_models/__init__.py lines 16–31
def __getattr__(name: str) -> None:
from langchain_community import chat_models
# If not in interactive env, raise warning.
if not is_interactive_env():
warnings.warn(
"Importing chat models from langchain is deprecated. Importing from "
"langchain will no longer be supported as of langchain==0.2.0. "
"Please import from langchain-community instead:\n\n"
f"`from langchain_community.chat_models import {name}`.\n\n"
"To install langchain-community run `pip install -U langchain-community`.",
stacklevel=2,
category=LangChainDeprecationWarning,
)
return getattr(chat_models, name)
Domain
Subdomains
Source
Frequently Asked Questions
What does __getattr__() do?
__getattr__() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chat_models/__init__.py.
Where is __getattr__() defined?
__getattr__() is defined in libs/langchain/langchain_classic/chat_models/__init__.py at line 16.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free