generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 499
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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.10
Python Version
3.13.3
Operating System
macOS 15.7
Installation Method
pip
Steps to Reproduce
- Create a Strands
SageMakerAIModelwith a dict ofadditional_argsin the endpoint config, for example:
model = SageMakerAIModel(
endpoint_config={
"endpoint_name": "{your-endpoint}",
"additional_args": {
"TargetContainerHostname": "my-cool-container",
},
},
)- Try to invoke the model (either direct or via an agent)
Expected Behavior
The additional_args should be passed through to the SageMaker AI endpoint.
Actual Behavior
Invocation fails with error at this line:
AttributeError: 'dict' object has no attribute '__dict__'
Additional Context
(At least in CPython 3.12 and 3.13 on macOS), it seems that dictionary objects don't have a __dict__ property. Maybe there are some other versions or platforms where this is/was working? I couldn't tell for sure from the Python docs.
The equivalent section in Strands BedrockModel is not broken, because it just directly passes through the self.config["additional_args"] rather than attempting to fetch .__dict__ of it.
Possible Solution
Since additional_args is type-hinted as a Python dictionary, I suggest the fix should be to remove the unnecessary .__dict__ accessor and just stick with:
# Add additional args if provided
if self.endpoint_config.get("additional_args"):
request.update(self.endpoint_config["additional_args"])Related Issues
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working