-
Notifications
You must be signed in to change notification settings - Fork 314
Open
Labels
area-providerRelated to model providersRelated to model providersbugSomething 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.1.0
Python Version
3.12.5
Operating System
Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Installation Method
pip
Steps to Reproduce
- Set WRITER_API_KEY environment variable.
- Set your AWS account ID at model ID (or change model ID to shorter one).
- Run the following code:
import json
from ddgs import DDGS
from dotenv import load_dotenv
from strands import Agent, tool
from strands.models import BedrockModel
load_dotenv()
@tool
def web_search(query: str) -> str:
"""
Function to research and collect more information to answer the query
Args:
query: The query that needs to be answered or more information needs to be collected.
"""
try:
results = DDGS().text(query=query, max_results=5)
return "\n".join([json.dumps(result) for result in results])
except Exception as e:
return f"Failed to search. Error: {e}"
model = BedrockModel(
model_id="arn:aws:bedrock:us-west-2:[YOUR AWS ACCOUNT ID]:inference-profile/us.writer.palmyra-x5-v1:0", #Or just us.writer.palmyra-x5-v1:0
temperature=0.3,
streaming=False,
)
agent = Agent(
model=model,
tools=[web_search],
system_prompt="You are an enterprise assistant that helps automate business workflows.",
)
response = agent("Research out Writer inc. the latest product")
Expected Behavior
The model should process the user request and compose a relevant response.
Actual Behavior
On model call, this error appears: strands.types.exceptions.EventLoopException: An error occurred (ValidationException) when calling the Converse operation: This model doesn't support the status field. Remove status and try again.
Additional Context
It seems like "under the hood" Strands inject "status" field into request without checking whether model supports it or not. For some older Antropic models, it works. But for majority models, this call causes an error.
It works for:
- model_id="us.anthropic.claude-3-5-haiku-20241022-v1:0"
- model_id="anthropic.claude-3-5-sonnet-20241022-v2:0"
- model_id="anthropic.claude-3-haiku-20240307-v1:0"
- model_id="anthropic.claude-3-5-sonnet-20240620-v1:0"
But doesn't work for these models, for examples:
- 'us.writer.palmyra-x5-v1:0'
- 'writer.palmyra-x5-v1:0'
- 'amazon.nova-micro-v1:0'
- 'huggingface-llm-mistral-nemo-base-2407'
- ‘anthropic.claude-opus-4-20250514-v1:0’
- ‘anthropic.claude-3-7-sonnet-20250219-v1:0’
- ‘meta.llama3-3-70b-instruct-v1:0’
Possible Solution
Exclude "status" field injection. If it really exists.
Related Issues
Metadata
Metadata
Assignees
Labels
area-providerRelated to model providersRelated to model providersbugSomething isn't workingSomething isn't working