From d39ace293c1cb446cd047398e9f7cd87df2eda7e Mon Sep 17 00:00:00 2001 From: chenhongsheng Date: Fri, 22 Mar 2024 00:21:50 +0800 Subject: [PATCH] fix init ChatMessagePromptTemplate error issue #1351 (#1535) fix init ChatMessagePromptTemplate error issue #1351.ChatMessagePromptTemplate init had role properties,but the params not passing through issue:https://github.com/logspace-ai/langflow/issues/1351 --- src/backend/langflow/interface/initialize/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/langflow/interface/initialize/utils.py b/src/backend/langflow/interface/initialize/utils.py index 5ecae3d70..0ef76836b 100644 --- a/src/backend/langflow/interface/initialize/utils.py +++ b/src/backend/langflow/interface/initialize/utils.py @@ -32,6 +32,8 @@ def check_tools_in_params(params: Dict): def instantiate_from_template(class_object, params: Dict): from_template_params = {"template": params.pop("prompt", params.pop("template", ""))} + + from_template_params.update(params) if not from_template_params.get("template"): raise ValueError("Prompt template is required") return class_object.from_template(**from_template_params)