Make default recursion_limit configurable by env var

This commit is contained in:
Nuno Campos
2025-03-12 16:45:45 -07:00
parent 74b2dbe1ea
commit 6973b19cc7
+3 -1
View File
@@ -1,4 +1,5 @@
from collections import ChainMap
from os import getenv
from typing import Any, Optional, Sequence, cast
from langchain_core.callbacks import (
@@ -11,7 +12,6 @@ from langchain_core.runnables import RunnableConfig
from langchain_core.runnables.config import (
CONFIG_KEYS,
COPIABLE_KEYS,
DEFAULT_RECURSION_LIMIT,
var_child_runnable_config,
)
@@ -26,6 +26,8 @@ from langgraph.constants import (
NS_SEP,
)
DEFAULT_RECURSION_LIMIT = int(getenv("LG_DEFAULT_RECURSION_LIMIT", "25"))
def recast_checkpoint_ns(ns: str) -> str:
"""Remove task IDs from checkpoint namespace.