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
v0.1.9
Python Version
Python 3.12.2
Operating System
15.5
Installation Method
pip
Steps to Reproduce
Replicating the same thing as
https://github.com/strands-agents/samples/tree/main/01-tutorials/02-multi-agent-systems/03-graph-agent
I have bedrock this version access and lower anthropic.claude-3-5-sonnet-20240620-v1:0.
So I am getting this error. Seems like model configuration is not passed downstream. I am using proper environment variables as well
Having this sonnet model .
model = BedrockModel(
model_id='anthropic.claude-3-5-sonnet-20240620-v1:0',
temperature=0.0,
top_p=0.0,
streaming=True,
region_name="us-east-1",
)
Step 1: Initialize an agent with agent_graph capability
coordinator_agent = Agent(model=model,tools=[agent_graph])
Errt that I get
model = BedrockModel(
model_id='anthropic.claude-3-5-sonnet-20240620-v1:0',
temperature=0.0,
top_p=0.0,
streaming=True,
region_name="us-east-1",
)
Step 1: Initialize an agent with agent_graph capability
coordinator_agent = Agent(model=model,tools=[agent_graph])
Step 2: Create a structured agent graph using the agent_graph tool
result = coordinator_agent.tool.agent_graph(
action="create",
graph_id="research_team",
topology={
"type": "star",
"nodes": [
{
"id": "coordinator",
"role": "team_lead",
"system_prompt": """You are a research team leader coordinating specialists.
provide a short analysis, no need for follow ups"""
},
{
"id": "data_analyst",
"role": "analyst",
"system_prompt": """You are a data analyst specializing in statistical analysis.
provide a short analysis, no need for follow ups"""
},
{
"id": "domain_expert",
"role": "expert",
"system_prompt": """You are a domain expert with deep subject knowledge.
provide a short analysis, no need for follow ups"""
}
],
"edges": [
{"from": "coordinator", "to": "data_analyst"},
{"from": "coordinator", "to": "domain_expert"},
{"from": "data_analyst", "to": "coordinator"},
{"from": "domain_expert", "to": "coordinator"}
]
}
)
print("Research team created successfully!")
print(f"Result: {result}")
Step 3: Check the status of our newly created network
status_result = coordinator_agent.tool.agent_graph(
action="status",
graph_id="research_team"
)
print("Network Status:")
print(status_result)
Step 4: Send a task to the coordinator
print("Sending task to the coordinator...")
message_result = coordinator_agent.tool.agent_graph(
action="message",
graph_id="research_team",
message={
"target": "coordinator",
"content": """Analyze the impact of remote work on employee productivity.
provide a short analysis, no need for follow ups"""
}
)
print("Task sent to coordinator!")
print(f"Response: {message_result}")
print("============================================================")
print("============================================================")
Step 5: Direct communication with specialists
print("Sending direct message to data analyst...")
analyst_result = coordinator_agent.tool.agent_graph(
action="message",
graph_id="research_team",
message={
"target": "data_analyst",
"content": """What are the key productivity metrics we should
track for remote work analysis? provide a short analysis, no need for follow ups"""
}
)
print(f"Data Analyst Response: {analyst_result}")
print("============================================================")
print("============================================================")
Step 6: List all active networks
print("Checking all active agent networks...")
list_result = coordinator_agent.tool.agent_graph(action="list")
print(f"Active Networks: {list_result}")
print("============================================================")
print("============================================================")
Manage the network
coordinator_agent("Shut down the content research_team when they're done")
Expected Behavior
This framework should use sonnet 3.5 but I think it does not inherit the same model property downstream
Actual Behavior
Error processing message in node coordinator: An error occurred (AccessDeniedException) when calling the ConverseStream operation: You don't have access to the model with the specified model ID.
This error should not occur
Additional Context
No response
Possible Solution
No response
Related Issues
No response