Repository navigation
Replies: 3 comments
|
As a workaround, we are currently implementing multimodal requests by specifying "." in the prompt as shown below. An empty string results in a validation error. |
|
#212 should address some of these use cases - the intent is to allow different types of input other than text to be passed into |
|
stream_async no longer has to be a string. The current signature takes AgentInput, and the docstring lists four forms: a str, a list of ContentBlock, a list of Message, or None to keep going from the history already on the agent. A content block list is the multimodal case, and the iterator still yields the same streaming events. An image block is {"image": {"format": "png", "source": {"bytes": image_bytes}}}. ImageContent in strands/types/media.py requires format and source, and ImageSource is either bytes or a location, not both. You can put a text block in the same list, so you do not need a dummy "." prompt. Passing None and putting the image on agent.messages yourself still works, but the content block list is the direct way and it streams. |
Uh oh!
There was an error while loading. Please reload this page.
I want to execute multimodal requests with Strands Agents (v0.2.1).
The stream_async function always requires a
prompt: strparameter when executed (source) and it gets added tomessagesas a user message. (relevant section) With this specification, it's not possible to handle use cases where you want to send images or files and have their content analyzed. Is there a way to omit the prompt? Note that the response needs to be streaming.All reactions