Skip to content

Commit

Permalink
Speed up chain import times
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj725 committed May 14, 2024
1 parent 9c8487d commit 2860b9b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion libs/community/langchain_community/chains/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@
This module contains the community chains.
"""

from langchain_community.chains.pebblo_retrieval.base import PebbloRetrievalQA
import importlib
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from langchain_community.chains.pebblo_retrieval.base import PebbloRetrievalQA

__all__ = ["PebbloRetrievalQA"]

_module_lookup = {
"PebbloRetrievalQA": "langchain_community.chains.pebblo_retrieval.base"
}


def __getattr__(name: str) -> Any:
if name in _module_lookup:
module = importlib.import_module(_module_lookup[name])
return getattr(module, name)
raise AttributeError(f"module {__name__} has no attribute {name}")


__all__ = list(_module_lookup.keys())

0 comments on commit 2860b9b

Please sign in to comment.