langgraph 0.1.12
Summary of Changes
- Improved the
ToolNodeprebuilt component to ensure consistent string output from tools by automatically converting non-string returns to JSON or string representations #1114
Detailed Changes
langgraph.prebuilt.tool_node.ToolNode
- Added new
str_outpututility function that intelligently converts any output to a string format #1114 - Modified both sync (
_run_one) and async (_arun_one) methods to ensure the content of returnedToolMessageis consistently a string #1114 - Added JSON serialization for structured outputs, with fallback to string representation for objects that can't be serialized to JSON #1114