1▶"""Module contains utility functions for working with messages.
2
3Some examples of what you can do with these functions include:
· · ·
3▶Some examples of what you can do with these functions include:
4
5* Convert messages to strings (serialization)
· · ·
16import math
17from collections.abc import Callable, Iterable, Sequence
18▶from functools import partial, wraps
19from typing import (
20 TYPE_CHECKING,
· · ·
43 is_data_content_block,
44)
45▶from langchain_core.messages.function import FunctionMessage, FunctionMessageChunk
46from langchain_core.messages.human import HumanMessage, HumanMessageChunk
47from langchain_core.messages.modifier import RemoveMessage
· · ·
89 | Annotated[ChatMessage, Tag(tag="chat")]
90 | Annotated[SystemMessage, Tag(tag="system")]
91▶ | Annotated[FunctionMessage, Tag(tag="function")]
92 | Annotated[ToolMessage, Tag(tag="tool")]
93 | Annotated[AIMessageChunk, Tag(tag="AIMessageChunk")]
+ 61 more matches in this file