generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 451
Open
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.13.0
Python Version
3.11.13
Operating System
Windows 11
Installation Method
pip
Steps to Reproduce
Passing non-bytes to source
model = BedrockModel()
content = [
{"text": "猫の嗅覚は優れてる?"},
{
"document": {
"format": "txt",
"name": "neko",
"source": {
"text": neko_source
},
"citations": {"enabled": True}
}
}
]
messages = [
{
"role":"user",
"content":content
}
]
model.stream(messages=messages)
Expected Behavior
Allow passing other types besides bytes
Actual Behavior
The sample passes text, which is supported in Bedrock and is valid format. However, it causes an error.
Additional Context
No response
Possible Solution
sdk-python/src/strands/models/bedrock.py
Line 386 in 78c59b9
| result["source"] = {"bytes": document["source"]["bytes"]} |
Just
result["source"] = {"bytes": document["source"]["bytes"]}
to
result["source"] = document["source"]
Related Issues
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working