mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
feat(core): allow _format_output to pass through list of ToolOutputMixin instances (#36963)
This commit is contained in:
@@ -1265,8 +1265,15 @@ def _format_output(
|
||||
status: The execution status.
|
||||
|
||||
Returns:
|
||||
The formatted output, either as a `ToolMessage` or the original content.
|
||||
The formatted output, either as a `ToolMessage`, the original content,
|
||||
or an unchanged list of `ToolOutputMixin` instances.
|
||||
"""
|
||||
if (
|
||||
isinstance(content, list)
|
||||
and content
|
||||
and all(isinstance(item, ToolOutputMixin) for item in content)
|
||||
):
|
||||
return content
|
||||
if isinstance(content, ToolOutputMixin) or tool_call_id is None:
|
||||
return content
|
||||
if not _is_message_content_type(content):
|
||||
|
||||
Reference in New Issue
Block a user