core[patch]: introduce ToolMessage.status (#24628)

Anthropic models (including via Bedrock and other cloud platforms)
accept a status/is_error attribute on tool messages/results
(specifically in `tool_result` content blocks for Anthropic API). Adding
a ToolMessage.status attribute so that users can set this attribute when
using those models
This commit is contained in:
Bagatur
2024-07-29 14:01:53 -07:00
committed by GitHub
parent 78d97b49d9
commit a6d1fb4275
9 changed files with 174 additions and 15 deletions

View File

@@ -127,6 +127,7 @@ def _merge_messages(
"type": "tool_result",
"content": curr.content,
"tool_use_id": curr.tool_call_id,
"is_error": curr.status == "error",
}
]
)