of input messages.
    """
    type: Literal["system"] = "system"
    is_chunk: Literal[False] = False
SystemMessage.update_forward_refs()
[docs]class SystemMessageChunk(SystemMessage, BaseMessageChunk):
    """A System Message chunk."""
    # Ignoring mypy re-assignment here since we're overriding the value
    # to make sure that the chunk variant can be discriminated from the
    # non-chunk variant.
    is_chunk: Literal[True] = True  # type: ignore[assignment]
[docs]class FunctionMessage(BaseMessage):
    """A Message for passing the result of executing a function back to a model."""
    name: str
    """The name of the function that was executed."""
    type: Literal["function"] = "function"
    is_chunk: Literal[False] = False
FunctionMessage.update_forward_refs()
[docs]class FunctionMessageChunk(FunctionMessage, BaseMessageChunk):
    """A Function Message chunk."""
    # Ignoring mypy re-assignment here since we're overriding the value
    # to make sure that the chunk variant can be discriminated from the
    # non-chunk variant.
    is_chunk: Literal[True] = True  # type: ignore[assignment]
    def __add__(self, other: Any) -> BaseMessageChunk:  # type: ignore
        if isinstance(other, FunctionMessageChunk):
            if self.name != other.name:
                raise ValueError(
                    "Cannot concatenate FunctionMessageChunks with different names."
                )
            return self.__class__(
                name=self.name,
                content=self.content + other.content,
                additional_kwargs=self._merge_kwargs_dict(
                    self.additional_kwargs, other.additional_kwargs
                ),
            )
        return super().__add__(other)