strands.experimental.bidi.types.agent
¶
Agent-related type definitions for bidirectional streaming.
This module defines the types used for BidiAgent.
BidiAgentInput = str | BidiTextInputEvent | BidiAudioInputEvent | BidiImageInputEvent
module-attribute
¶
BidiAudioInputEvent
¶
Bases: TypedEvent
Audio input event for sending audio to the model.
Used for sending audio data through the send() method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
audio
|
str
|
Base64-encoded audio string to send to model. |
required |
format
|
AudioFormat | str
|
Audio format from SUPPORTED_AUDIO_FORMATS. |
required |
sample_rate
|
AudioSampleRate
|
Sample rate from SUPPORTED_SAMPLE_RATES. |
required |
channels
|
AudioChannel
|
Channel count from SUPPORTED_CHANNELS. |
required |
Source code in strands/experimental/bidi/types/events.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
audio
property
¶
Base64-encoded audio string.
channels
property
¶
Number of audio channels (1=mono, 2=stereo).
format
property
¶
Audio encoding format.
sample_rate
property
¶
Number of audio samples per second in Hz.
__init__(audio, format, sample_rate, channels)
¶
Initialize audio input event.
Source code in strands/experimental/bidi/types/events.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
BidiImageInputEvent
¶
Bases: TypedEvent
Image input event for sending images/video frames to the model.
Used for sending image data through the send() method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
str
|
Base64-encoded image string. |
required |
mime_type
|
str
|
MIME type (e.g., "image/jpeg", "image/png"). |
required |
Source code in strands/experimental/bidi/types/events.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
image
property
¶
Base64-encoded image string.
mime_type
property
¶
MIME type of the image (e.g., "image/jpeg", "image/png").
__init__(image, mime_type)
¶
Initialize image input event.
Source code in strands/experimental/bidi/types/events.py
156 157 158 159 160 161 162 163 164 165 166 167 168 | |
BidiTextInputEvent
¶
Bases: TypedEvent
Text input event for sending text to the model.
Used for sending text content through the send() method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text content to send to the model. |
required |
role
|
Role
|
The role of the message sender (default: "user"). |
'user'
|
Source code in strands/experimental/bidi/types/events.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
role
property
¶
The role of the message sender.
text
property
¶
The text content to send to the model.
__init__(text, role='user')
¶
Initialize text input event.
Source code in strands/experimental/bidi/types/events.py
74 75 76 77 78 79 80 81 82 | |