**kwargs: keyword arguments to use for filling in templates in messages.
        Returns:
            A list of formatted messages with all template variables filled in.
        """
        # Get the examples to use.
        examples = self._get_examples(**kwargs)
        examples = [
            {k: e[k] for k in self.example_prompt.input_variables} for e in examples
        ]
        # Format the examples.
        messages = [
            message
            for example in examples
            for message in self.example_prompt.format_messages(**example)
        ]
        return messages
[docs]    def format(self, **kwargs: Any) -> str:
        """Format the prompt with inputs generating a string.
        Use this method to generate a string representation of a prompt consisting
        of chat messages.
        Useful for feeding into a string based completion language model or debugging.
        Args:
            **kwargs: keyword arguments to use for formatting.
        Returns:
            A string representation of the prompt
        """
        messages = self.format_messages(**kwargs)
        return get_buffer_string(messages)