Skip to content

The agent engineering platform.

docs(core): use proper admonition for `get_buffer_string` (#34967)

Mason Daugherty12c34a4139f8
diff --git a/libs/core/langchain_core/messages/utils.py b/libs/core/langchain_core/messages/utils.py
index c15296422f..baa55c2433 100644
--- a/libs/core/langchain_core/messages/utils.py
+++ b/libs/core/langchain_core/messages/utils.py
@@ -315,11 +315,14 @@ def get_buffer_string(
Raises:
ValueError: If an unsupported message type is encountered.
- Note:
+ !!! warning
+
If a message is an `AIMessage` and contains both tool calls under `tool_calls`
and a function call under `additional_kwargs["function_call"]`, only the tool
calls will be appended to the string representation.
+ !!! note "XML format"
+
When using `format='xml'`:
- All messages use uniform `<message type="role">content</message>` format.