Fix circular import

This commit is contained in:
Nuno Campos
2024-09-21 17:26:29 -07:00
parent 9f8d71c65b
commit 313e3eed3e
+13 -1
View File
@@ -1,9 +1,21 @@
from types import MappingProxyType
from typing import Any, Mapping
from langgraph.pregel.types import Interrupt, Send # noqa: F401
# Interrupt, Send re-exported for backwards compatibility
def __getattr__(name: str) -> Any:
if name in globals():
return globals()[name]
elif name == "Interrupt":
from langgraph.pregel.types import Interrupt
return Interrupt
elif name == "Send":
from langgraph.pregel.types import Send
return Send
raise AttributeError(f"module {__name__} has no attribute {name}")
# --- Empty read-only containers ---
EMPTY_MAP: Mapping[str, Any] = MappingProxyType({})