"""Format the prompt template.
        Args:
            **kwargs: Keyword arguments to use for formatting.
        Returns:
            Formatted message.
        """
        text = self.prompt.format(**kwargs)
        return AIMessage(content=text, additional_kwargs=self.additional_kwargs)
[docs]class SystemMessagePromptTemplate(BaseStringMessagePromptTemplate):
    """System message prompt template.
    This is a message that is not sent to the user.
    """
[docs]    def format(self, **kwargs: Any) -> BaseMessage:
        """Format the prompt template.
        Args:
            **kwargs: Keyword arguments to use for formatting.
        Returns:
            Formatted message.
        """
        text = self.prompt.format(**kwargs)
        return SystemMessage(content=text, additional_kwargs=self.additional_kwargs)
[docs]class ChatPromptValue(PromptValue):
    """Chat prompt value.
    A type of a prompt value that is built from messages.
    """
    messages: List[BaseMessage]
    """List of messages."""
[docs]    def to_string(self) -> str:
        """Return prompt as string."""
        return get_buffer_string(self.messages)
[docs]    def to_messages(self) -> List[BaseMessage]:
        """Return prompt as a list of messages."""
        return self.messages
[docs]class BaseChatPromptTemplate(BasePromptTemplate, ABC):
    """Base class for chat prompt templates."""
[docs]    def format(self, **kwargs: Any) -> str:
        """Format the chat template into a string.
        Args:
            **kwargs: keyword arguments to use for filling in template variables
                      in all the template messages in this chat template.
        Returns:
            formatted string
        """
        return self.format_prompt(**kwargs).to_string()