Skip to content

Commit 077af0c

Browse files
SoftEgLiTomas2D
andauthored
fix: deep copy PromptTemplate config to prevent shared mutable state across agents (#1419)
Signed-off-by: SoftEgLi <937423396@qq.com> Co-authored-by: Tomáš Dvořák <toomas2d@gmail.com>
1 parent 4cb4c1e commit 077af0c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python/beeai_framework/template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(
7878
functions=functions or {},
7979
defaults=defaults or {},
8080
)
81-
)
81+
).model_copy(deep=True)
8282

8383
def render(self, template_input: ModelLike[T] | None = None, /, **kwargs: Any) -> str:
8484
input_model = to_model_optional(self._config.input_schema, template_input)

0 commit comments

Comments
 (0)