generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 442
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
0.1.1
Python Version
3.11
Operating System
windows
Installation Method
pip
Steps to Reproduce
Although, I have the keys and secret in .env. I am getting "Your account is not authorized to invoke this API operation."
Below is the code I am running
boto_session = boto3.session.Session(aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name="us-west-1")
bedrock_model = BedrockModel(
model_id="us.anthropic.claude-3-7-sonnet-20250219-v1:0",
temperature=0.3,
boto_session=boto_session
)
agent = Agent(model=bedrock_model)
# Ask the agent a question
agent("Tell me about agentic AI")
To make it work, I had to update
strands/models/bedrock.py code as below
# updated self.client as below
class BedrockModel(Model):
....
....
self.client = boto3.client('bedrock-runtime', region_name="us-east-1")
# self.client = session.client(
# service_name="bedrock-runtime",
# config=client_config,
# )
Expected Behavior
It should not give me access violation as I already have access
Actual Behavior
getting error as "Your account is not authorized to invoke this API operation."
Additional Context
No response
Possible Solution
No response
Related Issues
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working