import { ... } from "@langchain/core/utils/format";A function that converts data from one format to another.
This is commonly used for transforming message content blocks between different provider-specific formats and standardized internal representations.
A pair of bidirectional conversion functions for transforming data between two formats.
This type is used throughout the message system to enable conversion between
provider-specific message formats (like OpenAI, Anthropic, Google, etc.) and
standardized internal content block representations. The encode function
typically converts from a standard format to a provider-specific format, while
decode converts from a provider-specific format back to the standard format.