Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/goose/src/providers/formats/bedrock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,18 @@ pub fn to_bedrock_message_content(content: &MessageContent) -> Result<bedrock::C
.map(|c| to_bedrock_tool_result_content_block(&tool_res.id, c.clone()))
.collect::<Result<_>>()?,
),
Err(_) => None,
Err(error) => {
// For errors, create a text content block with the error message
Some(vec![bedrock::ToolResultContentBlock::Text(format!(
"The tool call returned the following error:\n{}",
error
))])
}
};
bedrock::ContentBlock::ToolResult(
bedrock::ToolResultBlock::builder()
.tool_use_id(tool_res.id.to_string())
.status(if content.is_some() {
.status(if tool_res.tool_result.is_ok() {
bedrock::ToolResultStatus::Success
} else {
bedrock::ToolResultStatus::Error
Expand Down
Loading