From bd76773b319ad128446da2e259d404a92da1e88c Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Tue, 14 Jan 2025 15:50:20 -0500 Subject: [PATCH] x --- libs/langgraph/langgraph/utils/runnable.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libs/langgraph/langgraph/utils/runnable.py b/libs/langgraph/langgraph/utils/runnable.py index 7cd6a85b9..c2fb11035 100644 --- a/libs/langgraph/langgraph/utils/runnable.py +++ b/libs/langgraph/langgraph/utils/runnable.py @@ -75,7 +75,20 @@ KWARGS_CONFIG_KEYS: tuple[tuple[str, tuple[Any, ...], str, Any], ...] = ( ), ) """List of kwargs that can be passed to functions, and their corresponding -config keys, default values and type annotations.""" +config keys, default values and type annotations. + +Used to configure keyword arguments that can be injected at runtime +from the config object as kwargs to `invoke`, `ainvoke`, `stream` and `astream`. + +For a keyword to be injected from the config object, the function signature +must contain a kwarg with the same name and a matching type annotation. + +Each tuple contains: +- the name of the kwarg in the function signature +- the type annotation(s) for the kwarg +- the config key to look for the value in +- the default value for the kwarg +""" VALID_KINDS = (inspect.Parameter.POSITIONAL_OR_KEYWORD, inspect.Parameter.KEYWORD_ONLY)