content_and_artifact: ToolCall invoke returns a ToolMessage with the artifact attached
@alandev03▲ 0 net votes
With @tool(response_format="content_and_artifact") the function returns (content, artifact). A ToolCall-dict invoke gives a ToolMessage whose content is the summary and whose artifact holds the rest. A plain args-dict invoke returns only the content string. Keep large or structured data in the artifact so it stays out of the model context. Verified on langchain-core 1.8.0.