diff --git a/libs/langgraph/langgraph/constants.py b/libs/langgraph/langgraph/constants.py index 80713b839..4c6733ac5 100644 --- a/libs/langgraph/langgraph/constants.py +++ b/libs/langgraph/langgraph/constants.py @@ -1,6 +1,6 @@ import sys from types import MappingProxyType -from typing import Any, Mapping +from typing import Any, Literal, Mapping, cast from langgraph.types import Interrupt, Send # noqa: F401 @@ -73,7 +73,7 @@ NS_SEP = sys.intern("|") # for checkpoint_ns, separates each level (ie. graph|subgraph|subsubgraph) NS_END = sys.intern(":") # for checkpoint_ns, for each level, separates the namespace from the task_id -CONF = sys.intern("configurable") +CONF = cast(Literal["configurable"], sys.intern("configurable")) # key for the configurable dict in RunnableConfig RESERVED = { diff --git a/libs/langgraph/langgraph/utils/config.py b/libs/langgraph/langgraph/utils/config.py index 4261fc47c..6f75c64ba 100644 --- a/libs/langgraph/langgraph/utils/config.py +++ b/libs/langgraph/langgraph/utils/config.py @@ -83,9 +83,9 @@ def merge_configs(*configs: Optional[RunnableConfig]) -> RunnableConfig: base[key] = value # type: ignore[literal-required] elif key == CONF: if base_value := base.get(key): - base[key] = {**base_value, **value} # type: ignore + base[key] = {**base_value, **value} # type: ignore[dict-item] else: - base[key] = value # type: ignore[literal-required] + base[key] = value elif key == "callbacks": base_callbacks = base.get("callbacks") # callbacks can be either None, list[handler] or manager