Commit 870a89b
authored
Add support for multiple images and videos in response methods (#393)
* Add support for multiple images and videos in response methods
- Updated `respond` and `streamResponse` methods to accept `[UserInput.Image]?` and `[UserInput.Video]?` arrays.
- Added overloads to maintain backward compatibility with existing single `image` and `video` parameters.
- Simplified internal logic using default empty arrays for nil values, improving code readability and flexibility.
* Fix mismatched input types in `respond` method
- Changed parameters from `UserInput.Image?` and `UserInput.Video?` to `[UserInput.Image]?` and `[UserInput.Video]?`.
- Previously, the method expected arrays internally but accepted single optional inputs, leading to a mismatch.
- This fix ensures consistency and prepares for cleaner multi-input support in follow-up refactors.
* Fix missing `try await` in `respond` overload
- Corrected the call to the main async `respond` method by adding `try await`.
- Prevents async runtime errors and ensures the method correctly propagates asynchronous execution and error handling.
* Enforce non-optional arrays for media inputs
- Changed `images` and `videos` parameters in `respond` and `streamResponse` methods to be non-optional.
- Removed internal fallback to empty arrays (`?? []`), shifting responsibility to the caller.
- Updated doc comments to reflect that these inputs are now required as arrays.
- Clarifies the method contract and simplifies internal logic by eliminating conditional handling.1 parent 314dbab commit 870a89b
1 file changed
+56
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
| 182 | + | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
| 188 | + | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
196 | 198 | | |
197 | | - | |
198 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
| |||
204 | 207 | | |
205 | 208 | | |
206 | 209 | | |
207 | | - | |
208 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
209 | 231 | | |
210 | 232 | | |
211 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
212 | 236 | | |
213 | 237 | | |
214 | 238 | | |
215 | 239 | | |
216 | | - | |
217 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
218 | 243 | | |
219 | 244 | | |
220 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
221 | 265 | | |
0 commit comments