LangChain · Class
ToolMessage
ToolMessage sends a tool's result back to a chat model. Use tool_call_id to match the result with the tool request.
Last updated
- Since
- v1.7
Syntax
ToolMessage(self, content: str | list[str | dict[Any, Any]], tool_call_id: str, *, artifact: Any = None, status: Literal['success', 'error'] = 'success', content_blocks: list[types.ContentBlock] | None = None, kwargs: Any = {})In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
BaseMessageToolOutputMixincontent_blocksartifacttool_call_id