From 18551000bc4dce45d706c3fa1cae376f911b2cc1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Dec 2025 13:52:01 +0500 Subject: [PATCH] fix pipelineTool.from() --- haystack/tools/pipeline_tool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/haystack/tools/pipeline_tool.py b/haystack/tools/pipeline_tool.py index 0c0b6e1397..2152b5bbc2 100644 --- a/haystack/tools/pipeline_tool.py +++ b/haystack/tools/pipeline_tool.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 +import copy from typing import Any, Callable from haystack import AsyncPipeline, Pipeline, SuperComponent, logging @@ -221,7 +222,8 @@ def from_dict(cls, data: dict[str, Any]) -> "PipelineTool": :returns: The deserialized PipelineTool instance. """ - inner_data = data["data"] + # Create a deep copy to avoid mutating the input dictionary + inner_data = copy.deepcopy(data["data"]) is_pipeline_async = inner_data.get("is_pipeline_async", False) pipeline_class = AsyncPipeline if is_pipeline_async else Pipeline pipeline = pipeline_class.from_dict(inner_data["pipeline"])