" but with a different type."
                )
            elif isinstance(merged[k], str):
                merged[k] += v
            elif isinstance(merged[k], dict):
                merged[k] = self._merge_kwargs_dict(merged[k], v)
            else:
                raise ValueError(
                    f"Additional kwargs key {k} already exists in this message."
                )
        return merged
    def __add__(self, other: Any) -> BaseMessageChunk:  # type: ignore
        if isinstance(other, BaseMessageChunk):
            # If both are (subclasses of) BaseMessageChunk,
            # concat into a single BaseMessageChunk
            if isinstance(self, ChatMessageChunk):
                return self.__class__(
                    role=self.role,
                    content=self.content + other.content,
                    additional_kwargs=self._merge_kwargs_dict(
                        self.additional_kwargs, other.additional_kwargs
                    ),
                )
            return self.__class__(
                content=self.content + other.content,
                additional_kwargs=self._merge_kwargs_dict(
                    self.additional_kwargs, other.additional_kwargs
                ),
            )
        else:
            raise TypeError(
                'unsupported operand type(s) for +: "'
                f"{self.__class__.__name__}"
                f'" and "{other.__class__.__name__}"'
            )
[docs]class HumanMessage(BaseMessage):
    """A Message from a human."""
    example: bool = False
    """Whether this Message is being passed in to the model as part of an example 
        conversation.
    """
    type: Literal["human"] = "human"
    is_chunk: Literal[False] = False
HumanMessage.update_forward_refs()
[docs]class HumanMessageChunk(HumanMessage, BaseMessageChunk):
    """A Human Message chunk."""