From 439038fc3ad5f520d9352d660c323f9e9529c9c5 Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Thu, 24 Jul 2025 16:23:42 -0400 Subject: [PATCH] deprecation for config_schema in docs --- libs/langgraph/langgraph/func/__init__.py | 4 ++++ libs/langgraph/langgraph/graph/state.py | 4 ++++ libs/langgraph/langgraph/pregel/main.py | 1 + libs/langgraph/langgraph/runtime.py | 4 +++- libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py | 4 ++++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libs/langgraph/langgraph/func/__init__.py b/libs/langgraph/langgraph/func/__init__.py index 24ec545f7..ec453fec2 100644 --- a/libs/langgraph/langgraph/func/__init__.py +++ b/libs/langgraph/langgraph/func/__init__.py @@ -261,6 +261,10 @@ class entrypoint(Generic[ContextT]): passed to the workflow. cache_policy: A cache policy to use for caching the results of the workflow. retry_policy: A retry policy (or list of policies) to use for the workflow in case of a failure. + config_schema: Specifies the schema for the `configurable` key in the `RunnableConfig` object. + !!! warning "Deprecated" + This parameter is deprecated and support will be removed in v2.0.0. + Please use `context_schema` instead. Example: Using entrypoint and tasks ```python diff --git a/libs/langgraph/langgraph/graph/state.py b/libs/langgraph/langgraph/graph/state.py index 9e6d8552e..0bee5c0dc 100644 --- a/libs/langgraph/langgraph/graph/state.py +++ b/libs/langgraph/langgraph/graph/state.py @@ -128,6 +128,10 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]): Use this to expose immutable context data to your nodes, like user_id, db_conn, etc. input_schema: The schema class that defines the input to the graph. output_schema: The schema class that defines the output from the graph. + config_schema: Specifies the schema for the `configurable` key in the `RunnableConfig` object. + !!! warning "Deprecated" + This parameter is deprecated and support will be removed in v2.0.0. + Please use `context_schema` instead. Example: ```python diff --git a/libs/langgraph/langgraph/pregel/main.py b/libs/langgraph/langgraph/pregel/main.py index 1aec1da33..388fbf9ce 100644 --- a/libs/langgraph/langgraph/pregel/main.py +++ b/libs/langgraph/langgraph/pregel/main.py @@ -602,6 +602,7 @@ class Pregel( Defaults to None.""" context_schema: type[ContextT] | None = None + """Specifies the schema for the context object that will be passed to the workflow.""" config: RunnableConfig | None = None diff --git a/libs/langgraph/langgraph/runtime.py b/libs/langgraph/langgraph/runtime.py index c819f1d4e..c498584c2 100644 --- a/libs/langgraph/langgraph/runtime.py +++ b/libs/langgraph/langgraph/runtime.py @@ -26,7 +26,9 @@ class _RuntimeOverrides(TypedDict, Generic[ContextT], total=False): class Runtime(Generic[ContextT]): """Convenience class that bundles run-scoped context and graph configuration. - !!! version-added "Added in version 1.0.0." + !!! version-added "Added in version v0.6.0" + + TODO: write a compelling example with the new API. """ context: ContextT = field(default=None) # type: ignore[assignment] diff --git a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py index 7b63c528c..34c1a930b 100644 --- a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py @@ -363,6 +363,10 @@ def create_react_agent( name: An optional name for the CompiledStateGraph. This name will be automatically used when adding ReAct agent graph to another graph as a subgraph node - particularly useful for building multi-agent systems. + config_schema: Specifies the schema for the `configurable` key in the `RunnableConfig` object. + !!! warning "Deprecated" + This parameter is deprecated and support will be removed in v2.0.0. + Please use `context_schema` instead. Returns: A compiled LangChain runnable that can be used for chat interactions.