def format(self, **kwargs) -> List[Dict[str, str]]:
        """Format the messages template into a list of finalized messages.

        Args:
            **kwargs: keyword arguments to use for filling in template variables in all the template messages in this
                messages template.

        Returns:
            List[Dict[str, str]]: list of formatted messages, each message contains the role and the content.
        """
        kwargs = self._merge_partial_and_user_variables(**kwargs)
        result: List[Dict[str, str]] = [
            {
                "role": role,
                "content": formatter.format(content, **kwargs),
            }
            for role, content in self.template
        ]
        return result
Format the messages template into a list of finalized messages.

        Args:
            **kwargs: keyword arguments to use for filling in template variables in all the template messages in this
                messages template.

        Returns:
            List[Dict[str, str]]: list of formatted messages, each message contains the role and the content.
        
pikerag/prompts/message_template.py