Skip to content

Conversation

Tavernari
Copy link

@Tavernari Tavernari commented Sep 20, 2025

  • 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.

- 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.
- 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.
- 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.
@Tavernari
Copy link
Author

Tavernari commented Sep 20, 2025

I implemented it using my repo and branch on my XCode project and it worked well.

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant