mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-22 23:00:00 +00:00
Conditionally add pydantic v1 to namespace (#9202)
Conditionally add pydantic_v1 to namespace.
This commit is contained in:
parent
feec422bf7
commit
04bc5f3b18
@ -21,7 +21,11 @@ try:
|
||||
except ImportError:
|
||||
pydantic_v1 = importlib.import_module("pydantic")
|
||||
|
||||
sys.modules["pydantic_v1"] = pydantic_v1
|
||||
if "pydantic_v1" not in sys.modules:
|
||||
# Use a conditional because langchain experimental
|
||||
# will use the same strategy to add pydantic_v1 to sys.modules
|
||||
# and may run prior to langchain core package.
|
||||
sys.modules["pydantic_v1"] = pydantic_v1
|
||||
|
||||
from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain
|
||||
from langchain.cache import BaseCache
|
||||
|
Loading…
Reference in New Issue
Block a user