dont mutate metadata/tags (#19742)

This commit is contained in:
Harrison Chase 2024-03-29 17:55:27 -07:00 committed by GitHub
parent 368e35c3b1
commit 56525f2ac1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,9 +112,9 @@ class BasePromptTemplate(
) -> PromptValue:
config = ensure_config(config)
if self.metadata:
config["metadata"].update(self.metadata)
config["metadata"] = {**config["metadata"], **self.metadata}
if self.tags:
config["tags"].extend(self.tags)
config["tags"] = config["tags"] + self.tags
return self._call_with_config(
self._format_prompt_with_error_handling,
input,