Skip to content

Commit

Permalink
Add get_store function (#3112)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos authored Jan 21, 2025
2 parents ac64f50 + b2213e5 commit 6cbc7e8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libs/langgraph/langgraph/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
CONFIG_KEY_CHECKPOINT_ID,
CONFIG_KEY_CHECKPOINT_MAP,
CONFIG_KEY_CHECKPOINT_NS,
CONFIG_KEY_STORE,
NS_END,
NS_SEP,
)
from langgraph.store.base import BaseStore


def recast_checkpoint_ns(ns: str) -> str:
Expand Down Expand Up @@ -332,4 +334,9 @@ def get_config() -> RunnableConfig:
if var_config := var_child_runnable_config.get():
return var_config
else:
raise RuntimeError("Called get_configurable outside of a runnable context")
raise RuntimeError("Called get_config outside of a runnable context")


def get_store() -> BaseStore:
config = get_config()
return config[CONF][CONFIG_KEY_STORE]

0 comments on commit 6cbc7e8

Please sign in to comment.