diff --git a/libs/core/langchain_core/prompts/chat.py b/libs/core/langchain_core/prompts/chat.py index 8fec0bc09962f..5b477abd0d4da 100644 --- a/libs/core/langchain_core/prompts/chat.py +++ b/libs/core/langchain_core/prompts/chat.py @@ -1219,7 +1219,7 @@ def format_messages(self, **kwargs: Any) -> list[BaseMessage]: """ kwargs = self._merge_partial_and_user_variables(**kwargs) result = [] - + for message_template in self.messages: if isinstance(message_template, BaseMessage): # Check if the content contains any template variables