else:
            values["input_variables"] = list(input_vars)
        return values
[docs]    @classmethod
    def from_template(cls, template: str, **kwargs: Any) -> ChatPromptTemplate:
        """Create a chat prompt template from a template string.
        Creates a chat template consisting of a single message assumed to be from
        the human.
        Args:
            template: template string
            **kwargs: keyword arguments to pass to the constructor.
        Returns:
            A new instance of this class.
        """
        prompt_template = PromptTemplate.from_template(template, **kwargs)
        message = HumanMessagePromptTemplate(prompt=prompt_template)
        return cls.from_messages([message])
[docs]    @classmethod
    def from_role_strings(
        cls, string_messages: List[Tuple[str, str]]
    ) -> ChatPromptTemplate:
        """Create a chat prompt template from a list of (role, template) tuples.
        Args:
            string_messages: list of (role, template) tuples.
        Returns:
            a chat prompt template
        """
        return cls(
            messages=[
                ChatMessagePromptTemplate.from_template(template, role=role)
                for role, template in string_messages
            ]
        )
[docs]    @classmethod
    def from_strings(
        cls, string_messages: List[Tuple[Type[BaseMessagePromptTemplate], str]]
    ) -> ChatPromptTemplate:
        """Create a chat prompt template from a list of (role class, template) tuples.
        Args:
            string_messages: list of (role class, template) tuples.
        Returns:
            a chat prompt template
        """
        return cls.from_messages(string_messages)
[docs]    @classmethod
    def from_messages(
        cls,