From 7f989d3c3b466566be531f01b6096c9509425803 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Fri, 8 Aug 2025 13:02:59 -0400 Subject: [PATCH] feat(docs): clarify `ToolMessage` `content`field usage --- libs/core/langchain_core/v1/messages.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/core/langchain_core/v1/messages.py b/libs/core/langchain_core/v1/messages.py index 1f86188550a..e8fcca0f506 100644 --- a/libs/core/langchain_core/v1/messages.py +++ b/libs/core/langchain_core/v1/messages.py @@ -797,7 +797,13 @@ class ToolMessage(ToolOutputMixin): """ content: list[types.ContentBlock] - """Message content as a list of content blocks.""" + """Message content as a list of content blocks. + + The tool's output should be included in the content, mapped to the appropriate + content block type (e.g., text, image, etc.). For instance, if the tool call returns + a string, it should be wrapped in a ``TextContentBlock``. + + """ type: Literal["tool"] = "tool" """The type of the message. Must be a string that is unique to the message type.