[docs]    def to_messages(self) -> List[BaseMessage]:
        """Return prompt as messages."""
        return [HumanMessage(content=self.text)]
[docs]class ChatPromptValue(PromptValue):
    """Chat prompt value.
    A type of a prompt value that is built from messages.
    """
    messages: Sequence[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 list(self.messages)
[docs]    @classmethod
    def get_lc_namespace(cls) -> List[str]:
        """Get the namespace of the langchain object."""
        return ["langchain", "prompts", "chat"]
[docs]class ChatPromptValueConcrete(ChatPromptValue):
    """Chat prompt value which explicitly lists out the message types it accepts.
    For use in external schemas."""
    messages: Sequence[AnyMessage]
    type: Literal["ChatPromptValueConcrete"] = "ChatPromptValueConcrete"
[docs]    @classmethod
    def get_lc_namespace(cls) -> List[str]:
        """Get the namespace of the langchain object."""
        return ["langchain", "prompts", "chat"]