generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 424
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.0
Python Version
3.13.3
Operating System
macOS 15.7
Installation Method
pip
Steps to Reproduce
- Create a Strands
SageMakerAIModel
with a dict of additional_args in the payload config, for example:
model = SageMakerAIModel(
endpoint_config={
"endpoint_name": "{your-endpoint}",
},
payload_config={
"additional_args": {
"logprobs": True,
},
}
)
- Invoke the model (either direct or via an agent) and check the generated payload (or just call the
model.format_request(...)
method to check it out)
Expected Behavior
The extra parameters provided in payload_config.additional_args should be added to the Body
of every request.
Actual Behavior
The additional_args
are ignored because:
- This key of payload_config is (correctly) skipped over when directly adding config keys to the payload here... but
- Nothing after that actually unpacks the contents of additional_args to the payload as expected. Only the endpoint_config.additional args are addressed (here) which are different because those are actual boto3 parameters, not components within the payload.
Additional Context
As far as I can tell (since some docs are missing), it seems like the intention in the current implementation was for:
SageMakerAIEndpointConfig.additional_args
to allow inserting additional top-level SageMaker boto3invoke_endpoint(...)
orinvoke_endpoint_with_response_stream(...)
arguments (presumably for features likeEnableExplanations
, TargetContainerName`, or etc)SageMakerAIPayloadSchema.additional_args
to allow inserting additional fields to the actual body of your requests to the model (like requesting logprobs, setting non-standard hyperparameters, or etc).
Possible Solution
Assuming the above interpretation is correct, I think we just need to add a step in format_request()
to update the payload
with the self.payload_config["additional_args"]
, where they're present?
Related Issues
Found during investigation of #982
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working