Skip to content

[BUG] S3Location Does Not Work With All Models in Bedrock #1744

@ctoh-skechers

Description

@ctoh-skechers

Checks

  • I have updated to the lastest minor and patch version of Strands
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Strands Version

1.26.0

Python Version

3.12

Operating System

Windows

Installation Method

pip

Steps to Reproduce

  1. Attempt to use the new s3Location as part of the source location for document type messages
from strands import Agent
from strands.models import BedrockModel

agent = Agent(model=BedrockModel())

response = agent(
    [
        {
            "document": {
                "format": "pdf",
                "name": "report.pdf",
                "source": {
                    "location": {
                        "type": "s3",
                        "uri": f"s3://{bucket-name}/{key}",
                    }
                }
            }
        },
        {
            "text": "Summarize this document."
        }
    ]
)
  1. See this error: An unexpected error occurred. Please try again.', 'exception': 'An error occurred (ValidationException) when calling the ConverseStream operation: The model returned the following errors: messages.0.content.0.document.source.type: Field required'

Expected Behavior

It appears that s3Location may only be supported by Nova models? This should probably be made clear in the documentation as Strands Agents defaults to Claude models. Our AWS SA found this documentation Supported Model Features. You would expect this to be standard across all Bedrock models or at the very least the error should indicate if models do not support S3 Location.

Actual Behavior

s3Location does not seem to be supported for all Bedrock models.

Additional Context

No response

Possible Solution

Contact Bedrock Team to work on S3 Location Support for all models on Bedrock.
Or in the meantime indicate that the model does not support it clearly via Error/Exception.
Potentially could allow agents the ability to direct such requests to a model that does support S3Location but this likely would be a significant feature request and could cause other management issues in the lifecycle of an agent.

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingto-refineIssue needs to be discussed with the team and the team has come to an effort estimate consensus

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions