From 738d93215ddf8fe03cec6afd96b50cf6c99e635f Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Thu, 24 Aug 2023 17:20:49 +0200 Subject: [PATCH] Allow patching run_name and max_concurrency --- libs/langchain/langchain/schema/runnable/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/langchain/langchain/schema/runnable/config.py b/libs/langchain/langchain/schema/runnable/config.py index f12f1f83f3..e2274c134e 100644 --- a/libs/langchain/langchain/schema/runnable/config.py +++ b/libs/langchain/langchain/schema/runnable/config.py @@ -102,6 +102,8 @@ def patch_config( deep_copy_locals: bool = False, callbacks: Optional[BaseCallbackManager] = None, recursion_limit: Optional[int] = None, + max_concurrency: Optional[int] = None, + run_name: Optional[str] = None, ) -> RunnableConfig: config = ensure_config(config) if deep_copy_locals: @@ -114,6 +116,10 @@ def patch_config( config["run_id"] = None if recursion_limit is not None: config["recursion_limit"] = recursion_limit + if max_concurrency is not None: + config["max_concurrency"] = max_concurrency + if run_name is not None: + config["run_name"] = run_name return config