formatted string
        """
        return self.format_prompt(**kwargs).to_string()
[docs]    def format_prompt(self, **kwargs: Any) -> PromptValue:
        """
        Format prompt. Should return a PromptValue.
        Args:
            **kwargs: Keyword arguments to use for formatting.
        Returns:
            PromptValue.
        """
        messages = self.format_messages(**kwargs)
        return ChatPromptValue(messages=messages)
[docs]    @abstractmethod
    def format_messages(self, **kwargs: Any) -> List[BaseMessage]:
        """Format kwargs into a list of messages."""
[docs]class ChatPromptTemplate(BaseChatPromptTemplate, ABC):
    """A prompt template for chat models.
    Use to create flexible templated prompts for chat models.
    Examples:
        .. code-block:: python
            from langchain.prompts import ChatPromptTemplate
            template = ChatPromptTemplate.from_messages([
                ("system", "You are a helpful AI bot. Your name is {name}."),
                ("human", "Hello, how are you doing?"),
                ("ai", "I'm doing well, thanks!"),
                ("human", "{user_input}"),
            ])
            messages = template.format_messages(
                name="Bob",
                user_input="What is your name?"
            )
    """
    input_variables: List[str]
    """List of input variables in template messages. Used for validation."""
    messages: List[
        Union[BaseMessagePromptTemplate, BaseMessage, BaseChatPromptTemplate]
    ]
    """List of messages consisting of either message prompt templates or messages."""
    def __add__(self, other: Any) -> ChatPromptTemplate:
        """Combine two prompt templates.
        Args:
            other: Another prompt template.